squall 1.2.1beta1 → 1.3.0
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/squall/support/base.rb +4 -4
- data/lib/squall/support/exception.rb +0 -9
- data/lib/squall/support/version.rb +1 -1
- data/lib/squall.rb +0 -1
- data/spec/squall/data_store_zone_spec.rb +8 -20
- data/spec/squall/firewall_rule_spec.rb +0 -12
- data/spec/squall/hypervisor_spec.rb +24 -38
- data/spec/squall/hypervisor_zone_spec.rb +34 -46
- data/spec/squall/ip_address_join_spec.rb +1 -15
- data/spec/squall/ip_address_spec.rb +2 -6
- data/spec/squall/network_spec.rb +2 -12
- data/spec/squall/network_zone_spec.rb +15 -43
- data/spec/squall/payment_spec.rb +9 -22
- data/spec/squall/role_spec.rb +4 -16
- data/spec/squall/support/base_spec.rb +16 -10
- data/spec/squall/template_spec.rb +3 -8
- data/spec/squall/transaction_spec.rb +2 -6
- data/spec/squall/user_group_spec.rb +6 -14
- data/spec/squall/user_spec.rb +12 -44
- data/spec/squall/virtual_machine_spec.rb +0 -102
- data/spec/squall/whitelist_spec.rb +10 -26
- data/squall.gemspec +1 -1
- metadata +76 -161
- data/.rbenv-version +0 -1
- data/lib/squall/support/on_app_errors.rb +0 -23
@@ -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
|