From 625ea624cfb0802735908f97e69da3b5eb97bce6 Mon Sep 17 00:00:00 2001
From: Alexander Lovett <alexander.lovett@geant.org>
Date: Thu, 23 Apr 2020 12:15:18 +0000
Subject: [PATCH] [LGR-76] - Results page handle non 200 status
---
CHANGELOG.md | 3 +++
package.json | 4 ++--
.../interfaces/components/results/results.component.ts | 8 +++++++-
3 files changed, 12 insertions(+), 3 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 6f1e478..0ca53a9 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,6 @@
+# 2.0.13
+* [LGR-76](https://jira.software.geant.org/browse/LGR-76) - Results page handle non 200 status
+
# 2.0.12
* [LGR-73](https://jira.software.geant.org/browse/LGR-73) - Use inventory provider for router info
diff --git a/package.json b/package.json
index 88f447a..5900c26 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "looking-glass",
- "version": "2.0.12",
+ "version": "2.0.13",
"scripts": {
"ng": "ng",
"start": "ng serve",
@@ -30,7 +30,7 @@
"core-js": "^2.5.4",
"font-awesome": "^4.7.0",
"ionicons": "^4.4.6",
- "jquery": "^3.3.1",
+ "jquery": "3.2.1",
"leaflet": "1.3.1",
"leaflet-defaulticon-compatibility": "^0.1.1",
"leaflet.awesome-markers": "^2.0.4",
diff --git a/src/app/interfaces/components/results/results.component.ts b/src/app/interfaces/components/results/results.component.ts
index 28cf31d..d681284 100644
--- a/src/app/interfaces/components/results/results.component.ts
+++ b/src/app/interfaces/components/results/results.component.ts
@@ -4,6 +4,7 @@ import { Location } from '@angular/common';
import { from, of } from 'rxjs';
import { concatMap } from 'rxjs/operators';
import 'rxjs/add/operator/delay';
+import 'rxjs/add/operator/catch';
import { CommandService } from '../../../domain/command.service';
declare let $: any;
@@ -49,7 +50,12 @@ export class ResultsComponent implements OnInit {
.asXml(params.asXml=="true")
.build()
)
- ).mergeMap(request => commandService.execute(request))
+ ).mergeMap(request => commandService.execute(request)
+ .catch(e => {
+ console.log(e);
+ var message: String = (e != null && e.hasOwnProperty('message')) ? e.message : "Undefined error"
+ return of(new CommandService.CommandResult(request.getHost(), `Error: ${message}`, 0));
+ }))
.subscribe(
result => {
var results = context.queryResults$;
--
GitLab