bounce icon indicating copy to clipboard operation
bounce copied to clipboard

Clearer alias for .ignore

Open AdriVanHoudt opened this issue 3 years ago • 0 comments

Support plan

  • is this issue currently blocking your project? (yes/no): no
  • is this issue affecting a production system? (yes/no): no

Context

  • node version: 12.19.0
  • module version: 2.0.0
  • environment (e.g. node, browser, native): node
  • used with (e.g. hapi application, another framework, standalone, ...): hapi / any node thing
  • any other relevant information:

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

AdriVanHoudt avatar Oct 19 '20 08:10 AdriVanHoudt