From 04af5f2020f7ac966b20f5079fac9fbf08eac4d5 Mon Sep 17 00:00:00 2001 From: Thomas Parisot Date: Wed, 3 Apr 2024 16:58:43 +0200 Subject: [PATCH] =?UTF-8?q?fix(telepac):=20affiche=20les=20erreurs=20perso?= =?UTF-8?q?nnalis=C3=A9es=20plut=C3=B4t=20qu'une=20g=C3=A9n=C3=A9rique?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/OperatorSetup/Flow.test.js | 2 +- src/components/OperatorSetup/Sources/Telepac.vue | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/OperatorSetup/Flow.test.js b/src/components/OperatorSetup/Flow.test.js index c726f2cd..bc1886af 100644 --- a/src/components/OperatorSetup/Flow.test.js +++ b/src/components/OperatorSetup/Flow.test.js @@ -417,7 +417,7 @@ describe("OperatorSetupFlow", () => { }) const error = new AxiosError('Fichier invalide') - error.response = { status : 400 } + error.response = { status : 400, data: { error: 'Votre fichier ne semble pas être une déclaration' } } axios.__createMock.post.mockRejectedValueOnce(error) diff --git a/src/components/OperatorSetup/Sources/Telepac.vue b/src/components/OperatorSetup/Sources/Telepac.vue index f5f770e4..df54422c 100644 --- a/src/components/OperatorSetup/Sources/Telepac.vue +++ b/src/components/OperatorSetup/Sources/Telepac.vue @@ -55,7 +55,7 @@ async function handleFileUpload () { emit('upload:complete', { geojson, source, warnings, metadata }) } catch (error) { if (error.response?.status >= 400 && error.response?.status < 500) { - erreur.value = 'Votre fichier ne semble pas être une déclaration PAC valide.' + erreur.value = error.response.data.error } else { erreur.value = 'Erreur inconnue, merci de réessayer plus tard.' throw error