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 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.
-
#response ⇒ HTTParty::Response
The response from the server.
-
#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 Method Details
#[](key) ⇒ Object
Shortcut to access the response keys
51 52 53 |
# File 'lib/backblaze/errors.rb', line 51 def [](key) @response[key] end |
#code ⇒ String
The Backblaze B2 error code
29 30 31 |
# File 'lib/backblaze/errors.rb', line 29 def code self['code'] end |
#message ⇒ String
The Backblaze B2 error message which is a human explanation
43 44 45 |
# File 'lib/backblaze/errors.rb', line 43 def self['message'] end |
#response ⇒ HTTParty::Response
The response from the server
22 23 24 |
# File 'lib/backblaze/errors.rb', line 22 def response @response end |
#status ⇒ Integer
The Backblaze B2 request status
36 37 38 |
# File 'lib/backblaze/errors.rb', line 36 def status self['status'] end |