From b7625350f1cc423ded3ba6508c48d21ab6db444c Mon Sep 17 00:00:00 2001 From: Derek Begnoche Date: Thu, 9 Nov 2017 07:35:57 -0600 Subject: [PATCH] Fixing error message responses. Fixes #163 --- src/Squidex/app/framework/angular/http-extensions-impl.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Squidex/app/framework/angular/http-extensions-impl.ts b/src/Squidex/app/framework/angular/http-extensions-impl.ts index dfddb24b2..189e5395f 100644 --- a/src/Squidex/app/framework/angular/http-extensions-impl.ts +++ b/src/Squidex/app/framework/angular/http-extensions-impl.ts @@ -104,7 +104,7 @@ export function pretifyError(message: string): Observable { if (!(response.error instanceof Error)) { try { - const errorDto = JSON.parse(response.error); + const errorDto = typeof response.error === 'object' ? response.error : JSON.parse(response.error); if (response.status === 412) { result = new ErrorDto(response.status, 'Failed to make the update. Another user has made a change. Please reload.');