Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change assert() AssertionError to Error #314

Closed
hueniverse opened this issue Jun 26, 2019 · 4 comments
Closed

Change assert() AssertionError to Error #314

hueniverse opened this issue Jun 26, 2019 · 4 comments
Assignees
Milestone

Comments

@hueniverse
Copy link
Member

@hueniverse hueniverse commented Jun 26, 2019

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.

@hueniverse hueniverse added this to the 8.0.0 milestone Jun 26, 2019
@hueniverse hueniverse self-assigned this Jun 26, 2019
@kanongil

This comment has been minimized.

Copy link
Member

@kanongil kanongil commented Jun 26, 2019

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

This comment has been minimized.

Copy link
Member Author

@hueniverse hueniverse commented Jun 26, 2019

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

AdriVanHoudt added a commit to Salesflare/hapi-plugin-mysql that referenced this issue Jun 29, 2019
This might generate slightly different error objects
see hapijs/hoek#314 and hapijs/hoek#316
@lerouxb

This comment has been minimized.

Copy link

@lerouxb lerouxb commented Jul 1, 2019

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

@hueniverse

This comment has been minimized.

Copy link
Member Author

@hueniverse hueniverse commented Jul 1, 2019

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.