mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-10-20 17:41:37 +00:00
plugin: Improve HTTP error messages by using response body
This commit is contained in:
parent
1968e1fdb7
commit
57d5610a58
1 changed files with 3 additions and 2 deletions
|
|
@ -19,8 +19,9 @@ end
|
|||
|
||||
local function rejectFailedRequests(response)
|
||||
if response.code >= 400 then
|
||||
-- TODO: Nicer error types for responses, using response JSON if valid.
|
||||
return Promise.reject(tostring(response.code))
|
||||
local message = string.format("HTTP %s:\n%s", tostring(response.code), response.body)
|
||||
|
||||
return Promise.reject(message)
|
||||
end
|
||||
|
||||
return response
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue