From f9849feffc8d6a45ef4a540e081bd92b1ea59c1a Mon Sep 17 00:00:00 2001 From: Irfan Habib Date: Thu, 21 Jun 2018 15:19:10 +0100 Subject: [PATCH] Deal with non CF Jetstream failed requests --- src/frontend/app/store/effects/api.effects.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/frontend/app/store/effects/api.effects.ts b/src/frontend/app/store/effects/api.effects.ts index 3ed4199877..1216c99321 100644 --- a/src/frontend/app/store/effects/api.effects.ts +++ b/src/frontend/app/store/effects/api.effects.ts @@ -227,7 +227,7 @@ export class APIEffect { const errorCode = endpoint && endpoint.error ? endpoint.error.statusCode.toString() : '500'; let errorResponse = null; if (!succeeded) { - errorResponse = endpoint && (typeof endpoint.errorResponse !== 'string') ? + errorResponse = endpoint && (!!endpoint.errorResponse && typeof endpoint.errorResponse !== 'string') ? endpoint.errorResponse : {} as JetStreamCFErrorResponse; // Use defaults if values are not provided errorResponse.code = errorResponse.code || 0;