Class: Response::ParseError
- Inherits:
-
Middleware
- Object
- Middleware
- Response::ParseError
- Defined in:
- lib/faraday/response/parse_error.rb
Instance Method Summary collapse
Instance Method Details
#on_complete(env) ⇒ Object
5 6 7 8 9 |
# File 'lib/faraday/response/parse_error.rb', line 5 def on_complete(env) if 200 == env[:status] && 'unknown site' == env[:body] raise Faraday::Error::ParsingError, response_values(env) end end |
#response_values(env) ⇒ Object
11 12 13 |
# File 'lib/faraday/response/parse_error.rb', line 11 def response_values(env) {:status => env[:status], :headers => env[:response_headers], :body => env[:body]} end |