Skip to content

Improve server constructor argument validation error reporting#1005

Merged
geek merged 1 commit intohapijs:masterfrom
philbooth:master
Aug 5, 2013
Merged

Improve server constructor argument validation error reporting#1005
geek merged 1 commit intohapijs:masterfrom
philbooth:master

Conversation

@philbooth
Copy link
Copy Markdown
Contributor

Again, not sure if you guys will appreciate this change or not, but I found the error message a bit cryptic when I accidentally passed the wrong type in to the server constructor (port was a string).

Possibly it is just because I'm unfamiliar with that idiom of argument parsing (presumably it is to allow arguments in any order?), but I reckon I'd have diagnosed the problem more easily if the error message contained the values that were in error.

Just thought I'd offer this change in case it saves someone else time in the future, although I totally understand if you don't want to go down the route of optimising error messages for user stupidity! :)

geek added a commit that referenced this pull request Aug 5, 2013
Improve server constructor argument validation error reporting
@geek geek merged commit 66fd260 into hapijs:master Aug 5, 2013
jmonster pushed a commit to jmonster/hapi that referenced this pull request Feb 10, 2014
Improve server constructor argument validation error reporting
@lock lock bot locked as resolved and limited conversation to collaborators Jan 10, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants