-
Notifications
You must be signed in to change notification settings - Fork 93
Testing a custom error handler #374
-
I'm attempting to write a test to ensure a custom error handler is calling a logging service when an error occurs by deliberately mocking a malformed response and thus triggering the error (and the custom error handler). This works in production code but for some reason tests using Angular testing library are throwing an uncaught error and seems to be bypassing the custom error handler. The handler is supplied as a provider similarly to the production config as follows:
return { provide: ErrorHandler, useClass: ClientErrorHandler, };
Any help greatly appreciated!
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 1 comment 1 reply
-
Hi, could you please share a full reproduction?
Beta Was this translation helpful? Give feedback.
All reactions
-
Hi Tim so sorry for not getting back to you sooner as I got a bit sidetracked. I will look at reproducing this over the next few days. Thanks very much.
Beta Was this translation helpful? Give feedback.