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