Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Testing a custom error handler #374

Unanswered
allforabit asked this question in Q&A
Discussion options

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!

You must be logged in to vote

Replies: 1 comment 1 reply

Comment options

Hi, could you please share a full reproduction?

You must be logged in to vote
1 reply
Comment options

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet

AltStyle によって変換されたページ (->オリジナル) /