Exception: Files::APIError
- Defined in:
- lib/files.com/errors.rb
Direct Known Subclasses
AccountInBadStandingError, BadRequestError, InvalidParamsError, LockedError, NotAuthenticatedError, NotAuthorizedError, NotFoundError, ProcessingFailureError, ProcessingPendingError, RateLimitedError, 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.
45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/files.com/errors.rb', line 45 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.
36 37 38 |
# File 'lib/files.com/errors.rb', line 36 def detail @detail end |
#error ⇒ Object (readonly)
Returns the value of attribute error.
37 38 39 |
# File 'lib/files.com/errors.rb', line 37 def error @error end |
#errors ⇒ Object (readonly)
Returns the value of attribute errors.
38 39 40 |
# File 'lib/files.com/errors.rb', line 38 def errors @errors end |
#http_code ⇒ Object (readonly)
Returns the value of attribute http_code.
39 40 41 |
# File 'lib/files.com/errors.rb', line 39 def http_code @http_code end |
#instance ⇒ Object (readonly)
Returns the value of attribute instance.
40 41 42 |
# File 'lib/files.com/errors.rb', line 40 def instance @instance end |
#model_errors ⇒ Object (readonly)
Returns the value of attribute model_errors.
41 42 43 |
# File 'lib/files.com/errors.rb', line 41 def model_errors @model_errors end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
42 43 44 |
# File 'lib/files.com/errors.rb', line 42 def title @title end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
43 44 45 |
# File 'lib/files.com/errors.rb', line 43 def type @type end |