mirror of
https://github.com/BTMuli/TeyvatGuide.git
synced 2026-05-18 04:56:47 +08:00
♻️ 重构战绩数据请求逻辑,完善错误处理,适配新版本地图数据
This commit is contained in:
@@ -125,9 +125,7 @@ async function request<T>(
|
||||
} catch (error) {
|
||||
// 清除超时定时器
|
||||
clearTimeout(timeoutId);
|
||||
|
||||
let httpError: TGApp.App.Response.HttpErr;
|
||||
|
||||
if (typeof error === "object" && error !== null && "message" in error) {
|
||||
httpError = <TGApp.App.Response.HttpErr>error;
|
||||
} else if (error instanceof Error) {
|
||||
@@ -135,8 +133,6 @@ async function request<T>(
|
||||
} else {
|
||||
httpError = createHttpError(String(error), { cause: error });
|
||||
}
|
||||
// 记录错误日志 TODO:根据实际情况调整日志
|
||||
// await TGLogger.Error(`[TGHttps] Request failed: ${httpError.message}`);
|
||||
throw httpError;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user