class Backblaze::RequestError

Basic needs for error messages. @note this could be abstract, but just keeps things simple.

Public Class Methods

new(response) click to toggle source

Creates the Error @param [HTTParty::Response] response the json response

# File lib/backblaze/errors.rb, line 15
def initialize(response)
  @response = response
end

Public Instance Methods

[](key) click to toggle source

Shortcut to access the response keys @return [Object] the object stored at `key` in the response

# File lib/backblaze/errors.rb, line 51
def [](key)
  @response[key]
end
code() click to toggle source

The Backblaze B2 error code @return [String] error code

# File lib/backblaze/errors.rb, line 29
def code
  self['code']
end
message() click to toggle source

The Backblaze B2 error message which is a human explanation @return [String] the problem in human words

# File lib/backblaze/errors.rb, line 43
def message
  self['message']
end
response() click to toggle source

The response from the server @return [HTTParty::Response] the response

# File lib/backblaze/errors.rb, line 22
def response
  @response
end
status() click to toggle source

The Backblaze B2 request status @return [Integer] status code

# File lib/backblaze/errors.rb, line 36
def status
  self['status']
end