Browse Source

fix canHandle method to correctly handle error status code

pull/17983/head
Mahmut Gundogdu 2 years ago
parent
commit
ba11a233fe
  1. 6
      npm/ng-packs/packages/theme-shared/src/lib/services/status-code-error-handler.service.ts

6
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 {

Loading…
Cancel
Save