Exception: Nzbn::ApiError
Overview
API error with status code and response body
Direct Known Subclasses
AuthenticationError, AuthorizationError, NotFoundError, PreconditionFailedError, ServerError, ValidationError
Instance Attribute Summary collapse
-
#error_code ⇒ Object
readonly
Returns the value of attribute error_code.
-
#error_description ⇒ Object
readonly
Returns the value of attribute error_description.
-
#errors ⇒ Object
readonly
Returns the value of attribute errors.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Attributes inherited from Error
Instance Method Summary collapse
-
#initialize(message = nil, response: nil, status: nil) ⇒ ApiError
constructor
A new instance of ApiError.
Constructor Details
#initialize(message = nil, response: nil, status: nil) ⇒ ApiError
Returns a new instance of ApiError.
19 20 21 22 23 |
# File 'lib/nzbn/error.rb', line 19 def initialize( = nil, response: nil, status: nil) @status = status parse_response(response) if response super( || @error_description || 'API Error', response: response, code: @error_code) end |
Instance Attribute Details
#error_code ⇒ Object (readonly)
Returns the value of attribute error_code.
17 18 19 |
# File 'lib/nzbn/error.rb', line 17 def error_code @error_code end |
#error_description ⇒ Object (readonly)
Returns the value of attribute error_description.
17 18 19 |
# File 'lib/nzbn/error.rb', line 17 def error_description @error_description end |
#errors ⇒ Object (readonly)
Returns the value of attribute errors.
17 18 19 |
# File 'lib/nzbn/error.rb', line 17 def errors @errors end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
17 18 19 |
# File 'lib/nzbn/error.rb', line 17 def status @status end |