mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
more verbose status errors
This commit is contained in:
parent
34b3f59da2
commit
bbc75ae306
1 changed files with 3 additions and 3 deletions
|
@ -23,7 +23,7 @@ unless Fog.mocking?
|
|||
end
|
||||
|
||||
# Messages for nicer exceptions, from rfc2616
|
||||
def error_message(expected, actual)
|
||||
def error_message(expected, actual, response)
|
||||
@messages ||= {
|
||||
100 => 'Continue',
|
||||
101 => 'Switching Protocols',
|
||||
|
@ -65,7 +65,7 @@ unless Fog.mocking?
|
|||
503 => 'Service Unavailable',
|
||||
504 => 'Gateway Timeout'
|
||||
}
|
||||
"Expected(#{expected} #{@messages[expected]}) <=> Got(#{actual} #{@messages[actual]})"
|
||||
"Expected(#{expected} #{@messages[expected]}) <=> Got(#{actual} #{@messages[actual]}) #{response.inspect}"
|
||||
end
|
||||
|
||||
def request(params)
|
||||
|
@ -130,7 +130,7 @@ unless Fog.mocking?
|
|||
end
|
||||
|
||||
if params[:expects] && params[:expects] != response.status
|
||||
raise(error_message(params[:expects], response.status))
|
||||
raise(error_message(params[:expects], response.status, response))
|
||||
else
|
||||
response
|
||||
end
|
||||
|
|
Loading…
Add table
Reference in a new issue