revert custom error messages

This commit is contained in:
lohit
2025-05-27 19:40:51 +05:30
parent bf19645282
commit 9ad0f2d169
2 changed files with 0 additions and 4 deletions

View File

@@ -93,14 +93,12 @@ function makeAxiosInstance({ requestMaxRedirects = 5, disableCookies } = {}) {
if (redirectResponseCodes.includes(error.response.status)) {
if (redirectCount >= requestMaxRedirects) {
// todo: needs to be discussed whether the original error response message should be modified or not
error.response.data = `Maximum redirects (${requestMaxRedirects}) exceeded`;
return Promise.reject(error);
}
const locationHeader = error.response.headers.location;
if (!locationHeader) {
// todo: needs to be discussed whether the original error response message should be modified or not
error.response.data = 'Redirect location header missing';
return Promise.reject(error);
}

View File

@@ -275,8 +275,6 @@ function makeAxiosInstance({
type: 'error',
message: safeStringifyJSON(errorResponseData?.toString?.())
});
// todo: needs to be discussed whether the original error response message should be modified or not
error.response.data = `Maximum redirects (${requestMaxRedirects}) exceeded`;
return Promise.reject(error);
}