Skip to content

Commit

Permalink
Merge pull request #346 from AgenceBio/fix/telepac-import-errors
Browse files Browse the repository at this point in the history
  • Loading branch information
thom4parisot authored Apr 3, 2024
2 parents 80f4329 + 04af5f2 commit 2d3314a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/components/OperatorSetup/Flow.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion src/components/OperatorSetup/Sources/Telepac.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 2d3314a

Please sign in to comment.