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

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);