Fixed error handling

This commit is contained in:
Stefan Ollinger 2023-10-10 21:51:32 +02:00
parent ff3321d643
commit bd5bc4acb2

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