Currently, I am facing a challenge in implementing a custom error handler for my angular application. The issue seems to be working, but under some peculiar conditions only.
To view the implementation, you can check out the StackBlitz link provided below: https://stackblitz.com/edit/angular-mqvzba
Within the project, you will find a global-error-handler.service.ts file located inside the "app" folder, along with the hello.component.ts file and other component files.
I have already included the handling directive in the providers section of the app.module.ts. Interestingly, when I test the newly created error before throwing it, it does appear to be an instance of CustomError.
My expectation is to achieve the desired result without needing to uncomment the setTimeout function.
Key files to review: - src/app/global-error-handler.service.ts - src/app/app.module.ts - src/app/hello.component.ts