From 264fc14a83191c412af6e395489afb1608301a9b Mon Sep 17 00:00:00 2001 From: Nishit Suwal <81785002+NSUWAL123@users.noreply.github.com> Date: Tue, 23 Jul 2024 22:59:24 +0545 Subject: [PATCH] fix(project): display error generated on the backend (#1693) --- src/frontend/src/api/Project.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/frontend/src/api/Project.js b/src/frontend/src/api/Project.js index 37287839a1..e0af1a0d56 100755 --- a/src/frontend/src/api/Project.js +++ b/src/frontend/src/api/Project.js @@ -331,10 +331,11 @@ export const DownloadSubmissionGeojson = (url, projectName) => { a.click(); dispatch(ProjectActions.SetDownloadSubmissionGeojsonLoading(false)); } catch (error) { + const errortxt = JSON.parse(await error.response.data.text()).detail; dispatch( CommonActions.SetSnackBar({ open: true, - message: 'Failed to download submission geojson.', + message: errortxt || 'Failed to download submission geojson.', variant: 'error', duration: 2000, }),