Class: Response::RaiseFlickrError
- Inherits:
-
Middleware
- Object
- Middleware
- Response::RaiseFlickrError
- Defined in:
- lib/faraday/response/raise_flickr_error.rb
Instance Method Summary collapse
Instance Method Details
#on_complete(env) ⇒ Object
6 7 8 9 10 11 12 |
# File 'lib/faraday/response/raise_flickr_error.rb', line 6 def on_complete(env) if env[:body]['rsp'] and env[:body]['rsp']['stat'] == 'fail' raise Flickr::Error.new(env[:body]['rsp']['err']['code'] , env[:body]['rsp']['err']['msg']) elsif env[:body]['stat'] == 'fail' raise Flickr::Error.new(env[:body]['code'] , env[:body]['message']) end end |