mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-10-22 13:21:38 +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)
|
local function rejectFailedRequests(response)
|
||||||
if response.code >= 400 then
|
if response.code >= 400 then
|
||||||
-- TODO: Nicer error types for responses, using response JSON if valid.
|
local message = string.format("HTTP %s:\n%s", tostring(response.code), response.body)
|
||||||
return Promise.reject(tostring(response.code))
|
|
||||||
|
return Promise.reject(message)
|
||||||
end
|
end
|
||||||
|
|
||||||
return response
|
return response
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue