From e882e07ff950b5b743fef234abee2bb54499eaff Mon Sep 17 00:00:00 2001 From: Jeremy Clements <79224539+jeclrsg@users.noreply.github.com> Date: Wed, 4 Oct 2023 11:02:03 -0400 Subject: [PATCH] HPCC-30421 ECL Watch v9 fix LandingZone silent failure on upload Signed-off-by: Jeremy Clements <79224539+jeclrsg@users.noreply.github.com> --- .../components/forms/landing-zone/FileListForm.tsx | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/esp/src/src-react/components/forms/landing-zone/FileListForm.tsx b/esp/src/src-react/components/forms/landing-zone/FileListForm.tsx index cd89e811201..1112167f2a1 100644 --- a/esp/src/src-react/components/forms/landing-zone/FileListForm.tsx +++ b/esp/src/src-react/components/forms/landing-zone/FileListForm.tsx @@ -80,9 +80,14 @@ export const FileListForm: React.FunctionComponent = ({ .then(response => response.json()) .then(response => { setSubmitDisabled(false); - const DFUActionResult = response?.UploadFilesResponse?.UploadFileResults?.DFUActionResult; + const exceptions = response?.Exceptions?.Exception ?? []; + if (exceptions.length > 0) { + logger.error(exceptions[0]?.Message ?? nlsHPCC.ErrorUploadingFile); + return; + } + const DFUActionResult = response?.UploadFilesResponse?.UploadFileResults?.DFUActionResult ?? []; if (DFUActionResult.filter(result => result.Result !== "Success").length > 0) { - console.log("upload failed"); + logger.error(nlsHPCC.ErrorUploadingFile); } else { closeForm(); if (typeof onSubmit === "function") { @@ -90,7 +95,8 @@ export const FileListForm: React.FunctionComponent = ({ } reset(defaultValues); } - }); + }) + .catch(err => logger.error(err)); }; handleSubmit(