Exception: Files::APIError
- Defined in:
- lib/files.com/errors.rb
Direct Known Subclasses
BadRequestError, NotAuthenticatedError, NotAuthorizedError, NotFoundError, ProcessingFailureError, RateLimitedError, ServiceUnavailableError, SiteConfigurationError
Instance Attribute Summary collapse
-
#detail ⇒ Object
readonly
Returns the value of attribute detail.
-
#error ⇒ Object
readonly
Returns the value of attribute error.
-
#errors ⇒ Object
readonly
Returns the value of attribute errors.
-
#http_code ⇒ Object
readonly
Returns the value of attribute http_code.
-
#instance ⇒ Object
readonly
Returns the value of attribute instance.
-
#model_errors ⇒ Object
readonly
Returns the value of attribute model_errors.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Attributes inherited from Error
#code, #http_body, #http_headers, #http_status, #json_body, #message, #request_id, #response
Instance Method Summary collapse
-
#initialize(message = nil, **kwargs) ⇒ APIError
constructor
A new instance of APIError.
Methods inherited from Error
Constructor Details
#initialize(message = nil, **kwargs) ⇒ APIError
Returns a new instance of APIError.
33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/files.com/errors.rb', line 33 def initialize( = nil, **kwargs) @detail = kwargs.dig(:json_body, 'detail') @error = kwargs.dig(:json_body, 'error') @errors = kwargs.dig(:json_body, 'errors') @http_code = kwargs.dig(:json_body, 'http-code') @instance = kwargs.dig(:json_body, 'instance') @model_errors = kwargs.dig(:json_body, 'model_errors') @title = kwargs.dig(:json_body, 'title') @type = kwargs.dig(:json_body, 'type') super(, **kwargs) end |
Instance Attribute Details
#detail ⇒ Object (readonly)
Returns the value of attribute detail.
31 32 33 |
# File 'lib/files.com/errors.rb', line 31 def detail @detail end |
#error ⇒ Object (readonly)
Returns the value of attribute error.
31 32 33 |
# File 'lib/files.com/errors.rb', line 31 def error @error end |
#errors ⇒ Object (readonly)
Returns the value of attribute errors.
31 32 33 |
# File 'lib/files.com/errors.rb', line 31 def errors @errors end |
#http_code ⇒ Object (readonly)
Returns the value of attribute http_code.
31 32 33 |
# File 'lib/files.com/errors.rb', line 31 def http_code @http_code end |
#instance ⇒ Object (readonly)
Returns the value of attribute instance.
31 32 33 |
# File 'lib/files.com/errors.rb', line 31 def instance @instance end |
#model_errors ⇒ Object (readonly)
Returns the value of attribute model_errors.
31 32 33 |
# File 'lib/files.com/errors.rb', line 31 def model_errors @model_errors end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
31 32 33 |
# File 'lib/files.com/errors.rb', line 31 def title @title end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
31 32 33 |
# File 'lib/files.com/errors.rb', line 31 def type @type end |