Merge pull request #518 from dozed/fix/error-handling

Fixed error handling
This commit is contained in:
Anoop M D 2023-10-11 03:08:49 +05:30 committed by GitHub
commit 1979be6c4b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -23,9 +23,9 @@ function makeAxiosInstance() {
return response;
},
(error) => {
const end = Date.now();
const start = error.config.headers['request-start-time'];
if (error.response) {
const end = Date.now();
const start = error.config.headers['request-start-time'];
error.response.headers['request-duration'] = end - start;
}
return Promise.reject(error);