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:
parent
3731131a8d
commit
80d0c4b4ec
1 changed files with 2 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue