mirror of
https://github.com/discourse/discourse.git
synced 2024-11-25 09:42:07 +08:00
Include response body when raising an error in FileHelper#download
.
This commit is contained in:
parent
05a57d4f27
commit
6c65718301
|
@ -48,7 +48,7 @@ class FileHelper
|
|||
# attempt error API compatibility
|
||||
io = FakeIO.new
|
||||
io.status = [response.code, ""]
|
||||
raise OpenURI::HTTPError.new("#{response.code} Error", io)
|
||||
raise OpenURI::HTTPError.new("#{response.code} Error: #{response.body}", io)
|
||||
else
|
||||
log(:error, "FinalDestination did not work for: #{url}") if verbose
|
||||
throw :done
|
||||
|
|
|
@ -28,7 +28,7 @@ describe FileHelper do
|
|||
expect(e.io.status[0]).to eq("404")
|
||||
raise
|
||||
end
|
||||
end.to raise_error(OpenURI::HTTPError)
|
||||
end.to raise_error(OpenURI::HTTPError, "404 Error: 404")
|
||||
end
|
||||
|
||||
it "correctly raises an OpenURI HTTP error if it gets a 404" do
|
||||
|
|
Loading…
Reference in New Issue
Block a user