Exception: Jahuty::Exception::Error
- Inherits:
-
StandardError
- Object
- StandardError
- Jahuty::Exception::Error
- Defined in:
- lib/jahuty/exception/error.rb
Overview
Thrown when a client- or server-error occurs.
Instance Attribute Summary collapse
-
#problem ⇒ Object
readonly
Returns the value of attribute problem.
Instance Method Summary collapse
-
#initialize(problem) ⇒ Error
constructor
A new instance of Error.
- #message ⇒ Object
Constructor Details
#initialize(problem) ⇒ Error
Returns a new instance of Error.
9 10 11 12 13 |
# File 'lib/jahuty/exception/error.rb', line 9 def initialize(problem) @problem = problem super end |
Instance Attribute Details
#problem ⇒ Object (readonly)
Returns the value of attribute problem.
7 8 9 |
# File 'lib/jahuty/exception/error.rb', line 7 def problem @problem end |
Instance Method Details
#message ⇒ Object
15 16 17 |
# File 'lib/jahuty/exception/error.rb', line 15 def "The API responded with #{@problem.status}, #{@problem.type}: #{@problem.detail}" end |