fix axios error
Some checks failed
Deploy / CreateImage (push) Successful in 3m59s
Deploy / DeployService (push) Failing after 23s

This commit is contained in:
Nastya 2025-05-20 13:56:34 +03:00
parent 1989604370
commit fba39bec1d
2 changed files with 13 additions and 1 deletions

@ -186,7 +186,15 @@ export async function getQuizData({ quizId, status = "" }: { quizId: string; sta
const quizDataResponse = response.data;
if (response.error) {
throw response.error;
const axiosError = response.error as AxiosError;
if (axiosError.response?.data) {
throw new Error(
typeof axiosError.response.data === "string"
? axiosError.response.data
: JSON.stringify(axiosError.response.data)
);
}
throw axiosError;
}
if (!quizDataResponse) {
throw new Error("Quiz not found");

@ -6,7 +6,11 @@ type Props = Partial<FallbackProps>;
export const ApologyPage = ({ error }: Props) => {
let message = error.message || error.response?.data;
console.log("message");
console.log(message.toLowerCase());
const { t } = useTranslation();
console.log("t");
console.log(t(message.toLowerCase()));
return (
<Box