Exception: SirvRestApi::ApiError
- Defined in:
- lib/sirv_rest_api/errors.rb
Overview
Error raised when API returns an error response
Direct Known Subclasses
AuthenticationError, NotFoundError, RateLimitError, ValidationError
Instance Attribute Summary collapse
-
#error_code ⇒ Object
readonly
Returns the value of attribute error_code.
-
#message ⇒ Object
readonly
Returns the value of attribute message.
-
#status_code ⇒ Object
readonly
Returns the value of attribute status_code.
Instance Method Summary collapse
-
#initialize(message, status_code, error_code = nil) ⇒ ApiError
constructor
A new instance of ApiError.
Constructor Details
#initialize(message, status_code, error_code = nil) ⇒ ApiError
Returns a new instance of ApiError.
11 12 13 14 15 16 |
# File 'lib/sirv_rest_api/errors.rb', line 11 def initialize(, status_code, error_code = nil) @message = @status_code = status_code @error_code = error_code super() end |
Instance Attribute Details
#error_code ⇒ Object (readonly)
Returns the value of attribute error_code.
9 10 11 |
# File 'lib/sirv_rest_api/errors.rb', line 9 def error_code @error_code end |
#message ⇒ Object (readonly)
Returns the value of attribute message.
9 10 11 |
# File 'lib/sirv_rest_api/errors.rb', line 9 def @message end |
#status_code ⇒ Object (readonly)
Returns the value of attribute status_code.
9 10 11 |
# File 'lib/sirv_rest_api/errors.rb', line 9 def status_code @status_code end |