From e53c46464bf372b7fe88342e11f2f5b4ad0780e7 Mon Sep 17 00:00:00 2001 From: Maurizio Vitale Date: Fri, 17 Apr 2020 13:57:39 +0100 Subject: [PATCH] [ACA-2734] Fix API - Return an error in case the response isn't a json (#5622) * Return an error in case the response isn't a json * fix comma --- lib/core/services/discovery-api.service.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/core/services/discovery-api.service.ts b/lib/core/services/discovery-api.service.ts index a0d3a80e3b..5f3c643898 100644 --- a/lib/core/services/discovery-api.service.ts +++ b/lib/core/services/discovery-api.service.ts @@ -63,6 +63,12 @@ export class DiscoveryApiService { public getBPMSystemProperties(): Observable { return from(this.systemPropertiesApi.getProperties()) .pipe( + map( (res) => { + if ('string' === typeof(res)) { + throw new Error('Not valid response'); + } + return res; + }), catchError((err) => throwError(err.error)) ); }