Exception: Cloudflare::Artifacts::APIError

Inherits:
Error
  • Object
show all
Defined in:
lib/cloudflare/artifacts/error.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message = nil, status: nil, body: nil) ⇒ APIError

Returns a new instance of APIError.



10
11
12
13
14
15
# File 'lib/cloudflare/artifacts/error.rb', line 10

def initialize(message = nil, status: nil, body: nil)
  super(message)
  @status = status
  @body = body
  @errors = (body.is_a?(Hash) && body["errors"]) || []
end

Instance Attribute Details

#bodyObject (readonly)

Returns the value of attribute body.



8
9
10
# File 'lib/cloudflare/artifacts/error.rb', line 8

def body
  @body
end

#errorsObject (readonly)

Returns the value of attribute errors.



8
9
10
# File 'lib/cloudflare/artifacts/error.rb', line 8

def errors
  @errors
end

#statusObject (readonly)

Returns the value of attribute status.



8
9
10
# File 'lib/cloudflare/artifacts/error.rb', line 8

def status
  @status
end