Exception: Listo::Error::ClientError
- Defined in:
- lib/listo/error.rb
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#headers ⇒ Object
readonly
Returns the value of attribute headers.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Instance Method Summary collapse
-
#initialize(env) ⇒ ClientError
constructor
A new instance of ClientError.
Constructor Details
#initialize(env) ⇒ ClientError
Returns a new instance of ClientError.
9 10 11 12 13 14 15 |
# File 'lib/listo/error.rb', line 9 def initialize(env) @status = env.dig(:status) @headers = env.dig(:headers) @body = env.dig(:body) super("the server responded with status #{@status}") end |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
7 8 9 |
# File 'lib/listo/error.rb', line 7 def body @body end |
#headers ⇒ Object (readonly)
Returns the value of attribute headers.
7 8 9 |
# File 'lib/listo/error.rb', line 7 def headers @headers end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
7 8 9 |
# File 'lib/listo/error.rb', line 7 def status @status end |