From: Galen Charlton Date: Thu, 13 Jan 2022 23:27:58 +0000 (-0500) Subject: LP#1929749: catch and report upload errors X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=c42875aa23252aa2897d111a9b6ce51164eccb4f;p=working%2FEvergreen.git LP#1929749: catch and report upload errors Signed-off-by: Galen Charlton --- diff --git a/Open-ILS/src/eg2/src/app/staff/acq/picklist/upload.component.html b/Open-ILS/src/eg2/src/app/staff/acq/picklist/upload.component.html index 8a805eb463..ebf7d2f1a7 100644 --- a/Open-ILS/src/eg2/src/app/staff/acq/picklist/upload.component.html +++ b/Open-ILS/src/eg2/src/app/staff/acq/picklist/upload.component.html @@ -300,15 +300,25 @@
-
-

-
-
-
-
- -
-
Queue
- - -
+ +
+

+
+
Error {{uploadErrorCode}} ({{uploadErrorText}})
+
+
+
+ +
+

+
+
+ +
+ + + +
+
+
+ diff --git a/Open-ILS/src/eg2/src/app/staff/acq/picklist/upload.component.ts b/Open-ILS/src/eg2/src/app/staff/acq/picklist/upload.component.ts index 3b797b7190..f862c83d3b 100644 --- a/Open-ILS/src/eg2/src/app/staff/acq/picklist/upload.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/acq/picklist/upload.component.ts @@ -106,6 +106,9 @@ export class UploadComponent implements OnInit, AfterViewInit, OnDestroy { isUploading: boolean; uploadProcessing: boolean; + uploadError: boolean; + uploadErrorCode: string; + uploadErrorText: string; uploadComplete: boolean; // Generated by the server @@ -508,6 +511,7 @@ export class UploadComponent implements OnInit, AfterViewInit, OnDestroy { processUpload(): Promise { this.uploadProcessing = true; + this.uploadError = false; if (this.vlagent.importSelection) { return Promise.resolve(); @@ -549,7 +553,14 @@ export class UploadComponent implements OnInit, AfterViewInit, OnDestroy { progress => { const resp = this.evt.parse(progress); console.log(progress); - if (resp) { console.error(resp); return reject(); } + if (resp) { + this.uploadError = true; + this.uploadErrorCode = resp.textcode; + this.uploadErrorText = resp.payload; + this.uploadProcessing = false; + this.uploadComplete = true; + return reject(); + } if (progress.complete) { this.uploadProcessing = false; this.uploadComplete = true;