Change: log entire body for http error
This commit is contained in:
parent
c2646c7c1a
commit
bd6dd4b917
|
@ -87,10 +87,9 @@ const tokenManager = (() => {
|
||||||
if (r.ok) {
|
if (r.ok) {
|
||||||
return r.json();
|
return r.json();
|
||||||
}
|
}
|
||||||
return r.json()
|
return r.text()
|
||||||
.catch(console.warn)
|
.then(body => {
|
||||||
.then(json => {
|
throw new Error(`failed to fetch (${r.status}): ${body}`);
|
||||||
throw new Error(`failed to fetch (${r.status}): ${json && json.message}`);
|
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
.then(result =>
|
.then(result =>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user