squall 1.2.1beta1 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,23 +0,0 @@
1
- module Squall
2
- class OnAppErrors < Faraday::Response::Middleware
3
-
4
- def on_complete(env)
5
- # https://help.onapp.com/manual.php?m=2#p29
6
- case env[:status]
7
- when 403
8
- raise Squall::ForbiddenError, response_values(env)
9
- when 404
10
- raise Squall::NotFoundError, response_values(env)
11
- when 422
12
- raise Squall::ClientError, response_values(env)
13
- when 500
14
- raise Squall::ServerError, response_values(env)
15
- end
16
- end
17
-
18
- def response_values(env)
19
- {:status => env[:status], :headers => env[:response_headers], :body => env[:body]}
20
- end
21
-
22
- end
23
- end