[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
This commit is contained in:
Maurizio Vitale 2020-04-17 13:57:39 +01:00 committed by GitHub
parent e56331fecb
commit e53c46464b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -63,6 +63,12 @@ export class DiscoveryApiService {
public getBPMSystemProperties(): Observable<SystemPropertiesRepresentation> {
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))
);
}