Skip to content

Commit

Permalink
Check res.text as well to return a better error txt message (#1534)
Browse files Browse the repository at this point in the history
  • Loading branch information
AhyoungRyu authored and niftylettuce committed Jan 7, 2020
1 parent e3acc48 commit d957c81
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,9 @@ function Request(method, url) {
let new_err;
try {
if (!self._isResponseOK(res)) {
new_err = new Error(res.statusText || 'Unsuccessful HTTP response');
new_err = new Error(
res.statusText || res.text || 'Unsuccessful HTTP response'
);
}
} catch (err_) {
new_err = err_; // ok() callback can throw
Expand Down

0 comments on commit d957c81

Please sign in to comment.