Exception: Backblaze::RequestError
- Defined in:
- lib/backblaze/errors.rb
Overview
Note:
this could be abstract, but just keeps things simple.
Basic needs for error messages.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#response ⇒ HTTParty::Response
readonly
The response from the server.
Instance Method Summary collapse
-
#[](key) ⇒ Object
Shortcut to access the response keys.
-
#code ⇒ String
The Backblaze B2 error code.
-
#initialize(response) ⇒ RequestError
constructor
Creates the Error.
-
#message ⇒ String
The Backblaze B2 error message which is a human explanation.
-
#status ⇒ Integer
The Backblaze B2 request status.
Constructor Details
#initialize(response) ⇒ RequestError
Creates the Error
15 16 17 |
# File 'lib/backblaze/errors.rb', line 15 def initialize(response) @response = response end |
Instance Attribute Details
#response ⇒ HTTParty::Response (readonly)
The response from the server
22 23 24 |
# File 'lib/backblaze/errors.rb', line 22 def response @response end |
Instance Method Details
#[](key) ⇒ Object
Shortcut to access the response keys
48 49 50 |
# File 'lib/backblaze/errors.rb', line 48 def [](key) @response[key] end |
#code ⇒ String
The Backblaze B2 error code
27 28 29 |
# File 'lib/backblaze/errors.rb', line 27 def code self['code'] end |
#message ⇒ String
The Backblaze B2 error message which is a human explanation
41 42 43 |
# File 'lib/backblaze/errors.rb', line 41 def self['message'] end |
#status ⇒ Integer
The Backblaze B2 request status
34 35 36 |
# File 'lib/backblaze/errors.rb', line 34 def status self['status'] end |