hapijs / hoek

Node utilities shared among the extended hapi universe
Other
480 stars 171 forks source link

Change assert() AssertionError to Error #314

Closed hueniverse closed 5 years ago

hueniverse commented 5 years ago

assert() is meant for simple API input validation and developer errors. It should just throw to generate a stack + message. The existing implementation was also wrong because it was using the wrong node option for changing the stack starting point.

kanongil commented 5 years ago

This change goes against your point since it is no longer caught by the 'system' filter in Bounce, which means it will now be handled as an application error.

hueniverse commented 5 years ago

Hmm. I will make bounce identify it. Good point.

lerouxb commented 5 years ago

It used to be possible to pass your own error object rather than just an error message. Was this change intentional?

hueniverse commented 5 years ago

Nope. The test was bad so it got removed by mistake.

lock[bot] commented 4 years ago

This thread has been automatically locked due to inactivity. Please open a new issue for related bugs or questions following the new issue template instructions.