diff --git a/lib/errors/raise_error.rb b/lib/errors/raise_error.rb new file mode 100644 index 0000000..ef6bfde --- /dev/null +++ b/lib/errors/raise_error.rb @@ -0,0 +1,10 @@ +module Errors + class RaiseError < Faraday::Response::Middleware + + def on_complete(env) + raise Errors::NotFound if env[:status] == 404 + raise Errors::AuthError if env[:status] == 401 + end + + end +end