Exception: Cloudflare::Artifacts::APIError
- Defined in:
- lib/cloudflare/artifacts/error.rb
Direct Known Subclasses
AuthenticationError, BadRequestError, ConflictError, ForbiddenError, NotFoundError, RateLimitError, ServerError, UnprocessableEntityError
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#errors ⇒ Object
readonly
Returns the value of attribute errors.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Instance Method Summary collapse
-
#initialize(message = nil, status: nil, body: nil) ⇒ APIError
constructor
A new instance of APIError.
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( = nil, status: nil, body: nil) super() @status = status @body = body @errors = (body.is_a?(Hash) && body["errors"]) || [] end |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
8 9 10 |
# File 'lib/cloudflare/artifacts/error.rb', line 8 def body @body end |
#errors ⇒ Object (readonly)
Returns the value of attribute errors.
8 9 10 |
# File 'lib/cloudflare/artifacts/error.rb', line 8 def errors @errors end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
8 9 10 |
# File 'lib/cloudflare/artifacts/error.rb', line 8 def status @status end |