From f7811736954e483acd66cce5c2f32b41e2239ec6 Mon Sep 17 00:00:00 2001 From: "C. Fuhrman" Date: Sun, 2 Feb 2025 12:54:25 -0500 Subject: [PATCH] =?UTF-8?q?Afficher=20error=20(console)=20pour=20=C3=A9vit?= =?UTF-8?q?er=20warnings=20eslint?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/src/pages/Teacher/Dashboard/Dashboard.tsx | 3 ++- client/src/pages/Teacher/EditorQuiz/EditorQuiz.tsx | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/client/src/pages/Teacher/Dashboard/Dashboard.tsx b/client/src/pages/Teacher/Dashboard/Dashboard.tsx index 37c4057..3db6250 100644 --- a/client/src/pages/Teacher/Dashboard/Dashboard.tsx +++ b/client/src/pages/Teacher/Dashboard/Dashboard.tsx @@ -196,7 +196,8 @@ const Dashboard: React.FC = () => { // questions[i] = QuestionService.ignoreImgTags(questions[i]); const parsedItem = parse(questions[i]); Template(parsedItem[0]); - } catch (_error) { + } catch (error) { + console.error('Error parsing question:', error); return false; } } diff --git a/client/src/pages/Teacher/EditorQuiz/EditorQuiz.tsx b/client/src/pages/Teacher/EditorQuiz/EditorQuiz.tsx index 0a07905..9ae1eca 100644 --- a/client/src/pages/Teacher/EditorQuiz/EditorQuiz.tsx +++ b/client/src/pages/Teacher/EditorQuiz/EditorQuiz.tsx @@ -182,8 +182,8 @@ const QuizForm: React.FC = () => { if (fileInputRef.current) { fileInputRef.current.value = ''; } - } catch (_error) { - window.alert(`Une erreur est survenue.\n Veuillez réessayer plus tard`) + } catch (error) { + window.alert(`Une erreur est survenue.\n${error}\nVeuillez réessayer plus tard.`) } };