Exception: Anvil::APIError
Overview
API errors
Direct Known Subclasses
AuthenticationError, GraphQLError, NotFoundError, RateLimitError, ServerError, ValidationError
Instance Attribute Summary collapse
-
#errors ⇒ Object
readonly
Returns the value of attribute errors.
-
#status_code ⇒ Object
readonly
Returns the value of attribute status_code.
Attributes inherited from Error
Instance Method Summary collapse
-
#initialize(message, response = nil) ⇒ APIError
constructor
A new instance of APIError.
Constructor Details
#initialize(message, response = nil) ⇒ APIError
Returns a new instance of APIError.
28 29 30 31 32 |
# File 'lib/anvil/errors.rb', line 28 def initialize(, response = nil) @status_code = response&.code&.to_i @errors = parse_errors(response) if response super end |
Instance Attribute Details
#errors ⇒ Object (readonly)
Returns the value of attribute errors.
26 27 28 |
# File 'lib/anvil/errors.rb', line 26 def errors @errors end |
#status_code ⇒ Object (readonly)
Returns the value of attribute status_code.
26 27 28 |
# File 'lib/anvil/errors.rb', line 26 def status_code @status_code end |