Skip to content

Instantly share code, notes, and snippets.

### Keybase proof
I hereby claim:
* I am adoseofjess on github.
* I am adoseofjess (https://keybase.io/adoseofjess) on keybase.
* I have a public key whose fingerprint is 82B4 70D1 3B83 E2B6 6C65 5B28 9276 B351 3E77 6543
To claim this, I am signing this object:
### Keybase proof
I hereby claim:
* I am adoseofjess on github.
* I am adoseofjess (https://keybase.io/adoseofjess) on keybase.
* I have a public key whose fingerprint is F833 A5E6 E90D 73BE 3DDA 300E EDF0 9535 EEA1 2D45
To claim this, I am signing this object:
@adoseofjess
adoseofjess / gist:c7e928eb38c5f9972f96
Created October 29, 2014 17:32
Faraday Response::RaiseError
module Faraday
class Response::RaiseError < Response::Middleware
ClientErrorStatuses = 400...600
def on_complete(env)
case env[:status]
when 404
raise Faraday::Error::ResourceNotFound, response_values(env)
when 407
# mimic the behavior that we get with proxy requests with HTTPS