Exception: Polar::Error
- Inherits:
-
StandardError
- Object
- StandardError
- Polar::Error
- Defined in:
- lib/polar/error.rb
Defined Under Namespace
Classes: PolarError
Instance Attribute Summary collapse
-
#error ⇒ Object
readonly
Returns the value of attribute error.
-
#message ⇒ Object
readonly
Returns the value of attribute message.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(message, error: nil, status: nil) ⇒ Error
constructor
A new instance of Error.
Constructor Details
#initialize(message, error: nil, status: nil) ⇒ Error
8 9 10 11 12 |
# File 'lib/polar/error.rb', line 8 def initialize(, error: nil, status: nil) = @error = error @status = status end |
Instance Attribute Details
#error ⇒ Object (readonly)
Returns the value of attribute error.
14 15 16 |
# File 'lib/polar/error.rb', line 14 def error @error end |
#message ⇒ Object (readonly)
Returns the value of attribute message.
14 15 16 |
# File 'lib/polar/error.rb', line 14 def end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
14 15 16 |
# File 'lib/polar/error.rb', line 14 def status @status end |
Class Method Details
.from_response(response) ⇒ Object
16 17 18 19 |
# File 'lib/polar/error.rb', line 16 def self.from_response(response) error = PolarError.new(response.parse) new(name_for(response.status), error:, status: response.status) end |