Co-authored-by: Alex van Andel <me@alexvanandel.com>
This commit is contained in:
Srijan MukherjeeandAlex van Andel authored and GitHub committed 2023-05-02 16:56:29 +00:00
1 parent a88eb0fdc5
commit 9ba90e18de
1 file changed
+1 -1
+1 -1
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);
}