Exception: RakutenWebService::Error
- Inherits:
-
StandardError
- Object
- StandardError
- RakutenWebService::Error
show all
- Defined in:
- lib/rakuten_web_service/error.rb
Class Method Summary
collapse
Class Method Details
.for(response) ⇒ Object
9
10
11
12
|
# File 'lib/rakuten_web_service/error.rb', line 9
def self.for(response)
error_class = repository[response.code.to_i]
error_class.new(JSON.parse(response.body)['error_description'])
end
|
.register(status_code, error) ⇒ Object
5
6
7
|
# File 'lib/rakuten_web_service/error.rb', line 5
def self.register(status_code, error)
repository[status_code] = error
end
|
.repository ⇒ Object
14
15
16
|
# File 'lib/rakuten_web_service/error.rb', line 14
def self.repository
@repository ||= {}
end
|