Skip to content

Commit

Permalink
Simplified AusPASS errors to use status code.
Browse files Browse the repository at this point in the history
Fixed console bbox error.
  • Loading branch information
stuartwoodman committed Aug 26, 2024
1 parent 0a64c3a commit 59d033d
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions src/app/menupanel/common/downloadpanel/downloadpanel.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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 [email protected]');
} 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 [email protected]');
} 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);
}
});

}

/**
Expand Down

0 comments on commit 59d033d

Please sign in to comment.