Exception: MarketplaceKit::Errors::ApiError
- Inherits:
-
StandardError
- Object
- StandardError
- MarketplaceKit::Errors::ApiError
- Defined in:
- lib/marketplace_kit/errors/api_error.rb
Instance Attribute Summary collapse
-
#parsed_response ⇒ Object
readonly
Returns the value of attribute parsed_response.
Instance Method Summary collapse
- #details ⇒ Object
-
#initialize(parsed_response) ⇒ ApiError
constructor
A new instance of ApiError.
- #message ⇒ Object
- #meta_message ⇒ Object
Constructor Details
#initialize(parsed_response) ⇒ ApiError
Returns a new instance of ApiError.
6 7 8 9 |
# File 'lib/marketplace_kit/errors/api_error.rb', line 6 def initialize(parsed_response) @parsed_response = parsed_response super('Invalid API response!') end |
Instance Attribute Details
#parsed_response ⇒ Object (readonly)
Returns the value of attribute parsed_response.
4 5 6 |
# File 'lib/marketplace_kit/errors/api_error.rb', line 4 def parsed_response @parsed_response end |
Instance Method Details
#details ⇒ Object
19 20 21 |
# File 'lib/marketplace_kit/errors/api_error.rb', line 19 def details @parsed_response['details'] end |
#message ⇒ Object
11 12 13 |
# File 'lib/marketplace_kit/errors/api_error.rb', line 11 def @parsed_response['error'] || end |
#meta_message ⇒ Object
15 16 17 |
# File 'lib/marketplace_kit/errors/api_error.rb', line 15 def @parsed_response['meta']['message'] if @parsed_response['meta'] end |