Exception: Flickr::ApiError
- Defined in:
- lib/flickr/error.rb
Overview
This error is raised when there is an error in the request.
Instance Attribute Summary collapse
-
#code ⇒ Integer
readonly
Flickr’s code of the error.
Instance Method Summary collapse
-
#initialize(message = nil, code = nil) ⇒ ApiError
constructor
A new instance of ApiError.
- #message ⇒ Object
Constructor Details
#initialize(message = nil, code = nil) ⇒ ApiError
Returns a new instance of ApiError.
41 42 43 44 |
# File 'lib/flickr/error.rb', line 41 def initialize( = nil, code = nil) super() @code = code.to_i end |
Instance Attribute Details
#code ⇒ Integer (readonly)
Flickr’s code of the error. The list possible errors and their codes is shown below every API method on http://flickr.com/services/api. For example:
- 100: There is no API key
- 105: Service currently unavailable
- ...
36 37 38 |
# File 'lib/flickr/error.rb', line 36 def code @code end |
Instance Method Details
#message ⇒ Object
46 47 48 |
# File 'lib/flickr/error.rb', line 46 def "#{code}: #{super}" end |