Pull request #16: RED-4840: Fixed error message parsing.

Merge in SL/common-ui from RED-4840 to master

* commit 'f7c0f48d45079d20270ec5a105f76887a9f6b7b9':
  RED-4840: Fixed error message parsing.
This commit is contained in:
Nicoleta Panaghiu 2022-08-02 11:11:36 +02:00 committed by Timo Bejan
commit c17ba13b4f

View File

@ -15,6 +15,6 @@ export class ErrorMessageService {
}
private _parseErrorResponse(err: HttpErrorResponse): string {
return (err?.error?.message?.match('"message":"(.*?)\\"')?.[0] as string) || (err?.error?.message as string);
return (err?.error?.message?.match('"message":"(.*?)\\"')?.[0].replace(/"message":"|"/gm, '') as string) || (err?.error?.message as string);
}
}