parent
a88eb0fdc5
commit
9ba90e18de
|
@ -21,7 +21,7 @@ export async function handleErrorsJson<Type>(response: Response): Promise<Type>
|
||||||
return new Promise((resolve) => resolve({} as 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);
|
response.json().then(console.log);
|
||||||
throw Error(response.statusText);
|
throw Error(response.statusText);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue