Open Closed

Angular Http Error Handling, remove abp default dialog. #6674


User avatar
0
imranStem created

I have implemented the custom http error handler as below and registered in app module class.

export function handleHttpErrors(injector: Injector, httpError: HttpErrorResponse) {
  const toaster = injector.get(ToasterService);
  if (httpError.status === 403 || httpError.status === 400) {
    toaster.error(httpError.error?.error?.message || 'Error');
    return;
  }
  return throwError(httpError);
}
 providers: [{ provide: HTTP_ERROR_HANDLER, useValue: handleHttpErrors },.............]

The toaster message is displaying but dialog is also appearing.

  • ABP Framework version: v7.4.2
  • UI Type: Angular
  • Database System: EF Core (SQL Server)
  • Tiered (for MVC) or Auth Server Separated (for Angular): yes
  • Exception message and full stack trace:
  • Steps to reproduce the issue:

1 Answer(s)
  • User Avatar
    0
    Anjali_Musmade created
    Support Team Support Team Member

    Hello,

    Can you please check this link https://support.abp.io/QA/Questions/6220/Customize-HTTP-Error-Handler

    Thank You.

Made with ❤️ on ABP v8.2.0-preview Updated on March 25, 2024, 15:11