Co-authored-by: Alex van Andel <me@alexvanandel.com>
This commit is contained in:
1 parent
a88eb0fdc5
commit
9ba90e18de
1 file changed
+1
-1
@@ -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);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user