This commit is contained in:
dap
2024-08-31 16:11:35 +08:00
34 changed files with 476 additions and 345 deletions

View File

@@ -87,7 +87,7 @@ export const errorMessageResponseInterceptor = (
errMsg = $t('fallback.http.requestTimeout');
}
if (errMsg) {
makeErrorMessage?.(errMsg);
makeErrorMessage?.(errMsg, error);
return Promise.reject(error);
}
@@ -119,7 +119,7 @@ export const errorMessageResponseInterceptor = (
errorMessage = $t('fallback.http.internalServerError');
}
}
makeErrorMessage?.(errorMessage);
makeErrorMessage?.(errorMessage, error);
return Promise.reject(error);
},
};

View File

@@ -28,7 +28,7 @@ interface ResponseInterceptorConfig<T = any> {
rejected?: (error: any) => any;
}
type MakeErrorMessageFn = (message: string) => void;
type MakeErrorMessageFn = (message: string, error: any) => void;
interface HttpResponse<T = any> {
code: number;