|
@@ -47,7 +47,9 @@ export const request = async <T>(url: string, init: RequestInit = {}, timeout?:
|
|
|
}
|
|
|
|
|
|
if (!res.ok || res.status !== 200) {
|
|
|
- throw new Error(res.statusText);
|
|
|
+ const json = await res.json();
|
|
|
+ const errMsg: string = json.msg || json.error || '';
|
|
|
+ throw new Error(`HTTP Error: ${res.status} ${errMsg}`);
|
|
|
}
|
|
|
|
|
|
// if (res.url.includes('/Uboxlogin')) {
|