Skip to content
This repository has been archived by the owner on Feb 11, 2020. It is now read-only.

Commit

Permalink
Throw if config does not validate and callback is missing.
Browse files Browse the repository at this point in the history
Fixes #259
  • Loading branch information
mcollina committed Jan 19, 2016
1 parent d0c584d commit 2f60e30
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,11 @@ function Server(opts, callback) {

if (validationResult.errors.length > 0) {
var errMessage = validationResult.errors[0].message;
callback(new Error(errMessage));
if (callback) {
callback(new Error(errMessage));
} else {
throw new Error(errMessage);
}
}

modernOpts = options.populate(modernOpts);
Expand Down

0 comments on commit 2f60e30

Please sign in to comment.