perf: axios default error interceptor allows you to customize error handling (#4283)

This commit is contained in:
Vben
2024-08-30 22:06:02 +08:00
committed by GitHub
parent cc678a2b51
commit b3e3e05990
6 changed files with 10 additions and 9 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);
},
};