Skip to content

Commit

Permalink
Merge branch 'Merott-feature-error-callback' into canary
Browse files Browse the repository at this point in the history
  • Loading branch information
dignifiedquire committed Jun 4, 2015
2 parents d585032 + 8cd4ae9 commit 103ec6a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions docs/dev/04-public-api.md
Expand Up @@ -29,3 +29,7 @@ runner.run({port: 9876}, function(exitCode) {
process.exit(exitCode);
});
```

## Callback function notes

- If there is an error, the error code will be provided as the second parameter to the error callback.
2 changes: 1 addition & 1 deletion lib/runner.js
Expand Up @@ -54,7 +54,7 @@ exports.run = function(config, done) {
request.on('error', function(e) {
if (e.code === 'ECONNREFUSED') {
console.error('There is no server listening on port %d', options.port);
done(1);
done(1, e.code);
} else {
throw e;
}
Expand Down

0 comments on commit 103ec6a

Please sign in to comment.