hapijs / bounce

Selective error catching and rewrite rules
Other
176 stars 13 forks source link

Clearer alias for .ignore #28

Open AdriVanHoudt opened 4 years ago

AdriVanHoudt commented 4 years ago

Support plan

Context

What problem are you trying to solve?

I recently came upon a use case for .ignore:

try {
    await test.case();
}
catch (err) {
    bounce.ignore(err, { message : 'nope' });
    return;
}

But I ended up not using it as I didn't deem it clear enough for anyone not super familiar with Bounce what will happen there.

The accompanying slack discussion: https://hapihour.slack.com/archives/C6BMHNBLM/p1602682096074500

Do you have a new or modified API suggestion to solve the problem?

There were suggestion for Bounce.rethrowUnless() or Bounce.except() which I liked