Co-authored-by: Alex van Andel <me@alexvanandel.com>
pull/8577/head^2
Srijan Mukherjee 2023-05-02 22:26:29 +05:30 committed by GitHub
parent a88eb0fdc5
commit 9ba90e18de
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -21,7 +21,7 @@ export async function handleErrorsJson<Type>(response: Response): Promise<Type>
return new Promise((resolve) => resolve({} as Type));
}
if (!response.ok && response.status < 200 && response.status >= 300) {
if (!response.ok && (response.status < 200 || response.status >= 300)) {
response.json().then(console.log);
throw Error(response.statusText);
}