Class: Bkblz::V1::RequestError

Inherits:
BaseError
  • Object
show all
Defined in:
lib/bkblz/v1/request.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(error_response) ⇒ RequestError

Returns a new instance of RequestError.



19
20
21
# File 'lib/bkblz/v1/request.rb', line 19

def initialize(error_response)
  super error_response.message
end

Class Method Details

.create(error_response) ⇒ Object



10
11
12
13
14
15
16
17
# File 'lib/bkblz/v1/request.rb', line 10

def self.create(error_response)
  case error_response.to_model.status
  when 401
    UnauthorizedRequestError.new error_response
  else
    RequestError.new error_response
  end
end