fix(printer): increase timeout to 15s

This commit is contained in:
Amruth Pillai
2023-11-14 16:06:16 +01:00
parent 36b1930c0d
commit 457aed5f46
6 changed files with 28 additions and 34 deletions

View File

@ -1,5 +1,5 @@
import { t } from "@lingui/macro";
import { deepSearchAndParseDates } from "@reactive-resume/utils";
import { deepSearchAndParseDates, ErrorMessage } from "@reactive-resume/utils";
import _axios from "axios";
import createAuthRefreshInterceptor from "axios-auth-refresh";
import { redirect } from "react-router-dom";
@ -25,13 +25,16 @@ axios.interceptors.response.use(
return { ...response, data: transformedResponse };
},
(error) => {
const message = error.response?.data.message || error.message;
const message = error.response?.data.message as ErrorMessage;
const description = translateError(message);
toast({
variant: "error",
title: t`Oops, the server returned an error.`,
description: translateError(message),
});
if (description) {
toast({
variant: "error",
title: t`Oops, the server returned an error.`,
description,
});
}
return Promise.reject(error);
},