We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 82b771d commit e067a11Copy full SHA for e067a11
1 file changed
lib/errors/raise_error.rb
@@ -0,0 +1,10 @@
1
+module Errors
2
+ class RaiseError < Faraday::Response::Middleware
3
+
4
+ def on_complete(env)
5
+ raise Errors::NotFound if env[:status] == 404
6
+ raise Errors::AuthError if env[:status] == 401
7
+ end
8
9
10
+end
0 commit comments