1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

[joyent|compute] support for gracefully handling 400 error responses from api Fixes #3434

This commit is contained in:
Kevin Chan 2015-02-11 19:48:38 +08:00
parent 3731131a8d
commit 80d0c4b4ec

View file

@ -247,6 +247,8 @@ module Fog
def raise_if_error!(request, response)
case response.status
when 400 then
raise Joyent::Errors::BadRequest.new('Bad Request', request, response)
when 401 then
raise Joyent::Errors::Unauthorized.new('Invalid credentials were used', request, response)
when 403 then