From ba11a233fe8c2f1e5f8f55f3fac8e93ff8f1b8c9 Mon Sep 17 00:00:00 2001 From: Mahmut Gundogdu Date: Thu, 26 Oct 2023 10:26:58 +0300 Subject: [PATCH] fix canHandle method to correctly handle error status code --- .../src/lib/services/status-code-error-handler.service.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/npm/ng-packs/packages/theme-shared/src/lib/services/status-code-error-handler.service.ts b/npm/ng-packs/packages/theme-shared/src/lib/services/status-code-error-handler.service.ts index 35239819bf..976bb11702 100644 --- a/npm/ng-packs/packages/theme-shared/src/lib/services/status-code-error-handler.service.ts +++ b/npm/ng-packs/packages/theme-shared/src/lib/services/status-code-error-handler.service.ts @@ -57,9 +57,9 @@ export class StatusCodeErrorHandlerService implements CustomHttpErrorHandlerServ this.createErrorComponentService.execute(instance); } - canHandle({ status }): boolean { - this.status = status || 0; - return this.handledStatusCodes.indexOf(status) > -1; + canHandle(error): boolean { + this.status = error?.status || 0; + return this.handledStatusCodes.indexOf(this.status) > -1; } execute(): void {