Improve server constructor argument validation error reporting#1005
Merged
geek merged 1 commit intohapijs:masterfrom Aug 5, 2013
philbooth:master
Merged
Improve server constructor argument validation error reporting#1005geek merged 1 commit intohapijs:masterfrom philbooth:master
geek merged 1 commit intohapijs:masterfrom
philbooth:master
Conversation
geek
added a commit
that referenced
this pull request
Aug 5, 2013
Improve server constructor argument validation error reporting
jmonster
pushed a commit
to jmonster/hapi
that referenced
this pull request
Feb 10, 2014
Improve server constructor argument validation error reporting
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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! :)