Updated error when calling server.start with no callback#2739
Conversation
|
Nice. You should probably align the test and message with the stop() test here: https://github.com/hapijs/hapi/blob/master/lib/server.js#L258. |
|
Updated! Thanks for the feedback. 👍 |
|
Can you add a test for this as well? |
Updated the start method of server to verify that a callback was passed. If no callback is passed, a friendly error is thrown: `Error: A callback is required when calling server.start` Related to #2705
|
Done. |
|
@fiveisprime thanks for your contribution! It's very nice to have descriptive exceptions. I like the way "windsor" library shows its errors, very verbose and including way to fix them. This is an example: Source: http://kozmic.net/2011/02/16/windsors-longest-exception-message-just-got-longer/ |
|
@spiralni That's awesome! I can do something like this, but in a different pull I love this idea. :) |
Updated error when calling server.start with no callback
|
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. |

Updated the start method of server to verify that a callback was
passed. If no callback is passed, a friendly error is thrown.
This is compared to the old error which required some digging
to find the cause of the problem.
Related to #2705