Skip to content

Commit e067a11

Browse files
committed
adding raise error class
1 parent 82b771d commit e067a11

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

lib/errors/raise_error.rb

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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+
end
10+
end

0 commit comments

Comments
 (0)