Exception: ChartMogul::ChartMogulError
- Inherits:
-
StandardError
- Object
- StandardError
- ChartMogul::ChartMogulError
- Defined in:
- lib/chartmogul/errors/chartmogul_error.rb
Direct Known Subclasses
ConfigurationError, ForbiddenError, NotFoundError, ResourceInvalidError, SchemaInvalidError, UnauthorizedError
Instance Attribute Summary collapse
-
#http_status ⇒ Object
Returns the value of attribute http_status.
-
#message ⇒ Object
Returns the value of attribute message.
-
#response ⇒ Object
Returns the value of attribute response.
Instance Method Summary collapse
-
#initialize(message, http_status: nil, response: nil) ⇒ ChartMogulError
constructor
A new instance of ChartMogulError.
- #to_s ⇒ Object
Constructor Details
#initialize(message, http_status: nil, response: nil) ⇒ ChartMogulError
Returns a new instance of ChartMogulError.
7 8 9 10 11 |
# File 'lib/chartmogul/errors/chartmogul_error.rb', line 7 def initialize(, http_status:nil, response:nil) @message = @http_status = http_status @response = response end |
Instance Attribute Details
#http_status ⇒ Object
Returns the value of attribute http_status.
5 6 7 |
# File 'lib/chartmogul/errors/chartmogul_error.rb', line 5 def http_status @http_status end |
#message ⇒ Object
Returns the value of attribute message.
3 4 5 |
# File 'lib/chartmogul/errors/chartmogul_error.rb', line 3 def @message end |
#response ⇒ Object
Returns the value of attribute response.
4 5 6 |
# File 'lib/chartmogul/errors/chartmogul_error.rb', line 4 def response @response end |
Instance Method Details
#to_s ⇒ Object
13 14 15 16 17 |
# File 'lib/chartmogul/errors/chartmogul_error.rb', line 13 def to_s status = @http_status ? " (HTTP Status: #{@http_status.to_s})" : '' response = @response ? "\nResponse: #{@response.to_s}" : '' "#{}#{status}#{response}" end |