Browse Source
Merge pull request #17444 from abpframework/issue/17443
AngularUI: Fix error handler rest filter method
pull/17449/head
Masum ULU
3 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
8 additions and
5 deletions
-
npm/ng-packs/packages/theme-shared/src/lib/handlers/error.handler.ts
-
npm/ng-packs/packages/theme-shared/src/lib/services/router-error-handler.service.ts
|
|
|
@ -89,11 +89,11 @@ export class ErrorHandler { |
|
|
|
|
|
|
|
protected filterRestErrors = ({ status }: HttpErrorResponse): boolean => { |
|
|
|
if (typeof status !== 'number') return false; |
|
|
|
if(!this.httpErrorConfig.skipHandledErrorCodes){ |
|
|
|
|
|
|
|
if (!this.httpErrorConfig.skipHandledErrorCodes) { |
|
|
|
return true; |
|
|
|
} |
|
|
|
return ( |
|
|
|
this.httpErrorConfig.skipHandledErrorCodes.findIndex(code => code === status) < 0 |
|
|
|
); |
|
|
|
|
|
|
|
return this.httpErrorConfig.skipHandledErrorCodes.findIndex(code => code === status) < 0; |
|
|
|
}; |
|
|
|
} |
|
|
|
|
|
|
|
@ -20,9 +20,12 @@ export class RouterErrorHandlerService { |
|
|
|
} |
|
|
|
|
|
|
|
protected filterRouteErrors = (navigationError: NavigationError): boolean => { |
|
|
|
if (!this.httpErrorConfig.skipHandledErrorCodes) { |
|
|
|
return true; |
|
|
|
} |
|
|
|
|
|
|
|
return ( |
|
|
|
navigationError.error?.message?.indexOf('Cannot match') > -1 && |
|
|
|
!!this.httpErrorConfig.skipHandledErrorCodes && |
|
|
|
this.httpErrorConfig.skipHandledErrorCodes.findIndex(code => code === 404) < 0 |
|
|
|
); |
|
|
|
}; |
|
|
|
|