Merge pull request #17444 from abpframework/issue/17443

AngularUI: Fix error handler rest filter method
pull/17449/head
Masum ULU 1 year ago committed by GitHub
commit 0b40016c1c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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
);
};

Loading…
Cancel
Save