refactor: standardize error handling across components by utilizing CustomApiError for improved error messaging

This commit is contained in:
Junyan Qin
2026-01-03 00:56:25 +08:00
parent b0b7b914d8
commit 914f77ff37
14 changed files with 38 additions and 241 deletions
+4
View File
@@ -19,3 +19,7 @@ export interface ComponentManifest {
};
spec: Record<string, any>; // eslint-disable-line @typescript-eslint/no-explicit-any
}
export interface CustomApiError {
msg?: string;
}
+1 -1
View File
@@ -147,7 +147,7 @@ export abstract class BaseHttpClient {
// 错误处理
protected handleError(error: object): never {
if (axios.isCancel(error)) {
throw { code: -2, message: 'Request canceled', data: null };
throw { code: -2, msg: 'Request canceled', data: null };
}
throw error;
}