From 59d033d6ca294a02267a521df48e0aaf06d2092d Mon Sep 17 00:00:00 2001 From: "stuart.woodman" Date: Tue, 27 Aug 2024 09:30:42 +1000 Subject: [PATCH] Simplified AusPASS errors to use status code. Fixed console bbox error. --- .../downloadpanel/downloadpanel.component.ts | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/app/menupanel/common/downloadpanel/downloadpanel.component.ts b/src/app/menupanel/common/downloadpanel/downloadpanel.component.ts index ddbc24ed..ea5b0e33 100644 --- a/src/app/menupanel/common/downloadpanel/downloadpanel.component.ts +++ b/src/app/menupanel/common/downloadpanel/downloadpanel.component.ts @@ -484,14 +484,7 @@ export class DownloadPanelComponent implements OnInit { if (this.irisDownloadListOption.selectedserviceType === 'Station') { observableResponse = this.downloadIrisService.downloadIRISStation(this.layer, this.bbox, station, channel, start, end); } else { - observableResponse = this.downloadIrisService.downloadIRISDataselect(this.layer, station, channel, start, end) - .pipe( - catchError(err => { - // Handle the error or log it - alert('Please narrow down the date range, as the request data is too large.') - return throwError(err); - }) - ); + observableResponse = this.downloadIrisService.downloadIRISDataselect(this.layer, station, channel, start, end); } // Standard WFS feature download as a CSV } else { @@ -508,17 +501,24 @@ export class DownloadPanelComponent implements OnInit { this.downloadStarted = false; if (UtilitiesService.isEmpty(err.message)) { alert('An error has occurred whilst attempting to download. Please contact cg-admin@csiro.au'); - } else if (err.status === 413 && this.irisDownloadListOption) { + } + + else if (err.status === 413 && this.irisDownloadListOption) { alert('An error has occurred whilst attempting to download. (Request entity is too large, please reduce the size by limiting the stations, channels, or time period.) Please contact cg-admin@csiro.au'); } else { - alert('There is an error, when downloading (' + this.layer.name + ') layer at location (' + + let alertMessage = 'There is an error, when downloading (' + this.layer.name + ') layer'; + if (this.bbox) { + alertMessage += ' at location (' + 'eLongitude:' + Math.floor(this.bbox.eastBoundLongitude) + ' nLatitude: ' + Math.floor(this.bbox.northBoundLatitude) + ' sLatitude:' + Math.floor(this.bbox.southBoundLatitude) + ' wLongitude:' + Math.floor(this.bbox.westBoundLongitude) - + '). Detail of the error: (' + err.message + ')'); + + '). Detail of the error: (' + err.message + ')'; + } + alert(alertMessage); } }); + } /**