79
80
81
82
83
84
85
86
87
88
|
# File 'lib/zold/remotes.rb', line 79
def assert_code(code, response)
msg = response.status_line.strip
return if response.status.to_i == code
if response. && response.['X-Zold-Error']
raise CantAssert, "Error ##{response.status} \"#{response.['X-Zold-Error']}\" \
at #{response.['X-Zold-Path']}"
end
raise CantAssert, "Unexpected HTTP code #{response.status}, instead of #{code}" if msg.empty?
raise CantAssert, "#{msg} (HTTP code #{response.status}, instead of #{code})"
end
|