Skip to content

Commit b8340ce

Browse files
char0ndavidyuk
andauthored
fix(http): add failback error message in case if HTTP/2 in Chrome (#2136)
Co-authored-by: Denis Davidyuk <[email protected]>
1 parent 71a044d commit b8340ce

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/http.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,14 +71,14 @@ export default async function http(url, request = {}) {
7171
// so we'll just throw the error we got
7272
throw resError;
7373
}
74-
const error = new Error(res.statusText);
74+
const error = new Error(res.statusText || `response status is ${res.status}`);
7575
error.status = res.status;
7676
error.statusCode = res.status;
7777
error.responseError = resError;
7878
throw error;
7979
}
8080
if (!res.ok) {
81-
const error = new Error(res.statusText);
81+
const error = new Error(res.statusText || `response status is ${res.status}`);
8282
error.status = res.status;
8383
error.statusCode = res.status;
8484
error.response = res;

0 commit comments

Comments
 (0)