Change: log entire body for http error

This commit is contained in:
eight 2019-09-27 13:44:31 +08:00
parent c2646c7c1a
commit bd6dd4b917

View File

@ -87,10 +87,9 @@ const tokenManager = (() => {
if (r.ok) {
return r.json();
}
return r.json()
.catch(console.warn)
.then(json => {
throw new Error(`failed to fetch (${r.status}): ${json && json.message}`);
return r.text()
.then(body => {
throw new Error(`failed to fetch (${r.status}): ${body}`);
});
})
.then(result =>