Commit 210c455d authored by Alf Eaton's avatar Alf Eaton

Attach the response to the thrown error

parent 45fe8544
Pipeline #1560 passed with stage
in 2 minutes and 56 seconds
......@@ -30,7 +30,7 @@ const request = (url, options = {}) => {
return fetch(url, options).then(response => {
if (!response.ok) {
const error = new Error(response.statusText || response.status)
error.response = response.text() // NOTE: this is a promise
error.response = response
throw error
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment