Skip to content

How to disable immediate checks for Unhandled Promise rejections? #3289

Answered by jcubic
jcubic asked this question in Q&A
Discussion options

You must be logged in to vote

I was able to fix the issue by ignoring the exception I used to escape from try..catch:

    process.on('unhandledRejection', (reason, promise) => {
        if (reason instanceof IgnoreException) {
            promise.catch(noop);
        }
    });

The same function can be used to ignore any unhandled rejection reported by AVA.

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by jcubic
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants