Permalink
Browse files

better error handler for the cli tool

  • Loading branch information...
1 parent e36877f commit 88425dcb050e66ec0d003c2a6599e9d91cbb71e5 @substack committed Jan 15, 2012
Showing with 5 additions and 1 deletion.
  1. +5 −1 bin/bouncy.js
View
@@ -21,7 +21,11 @@ bouncy(function (req, bounce) {
}
req.on('error', onerror);
- function onerror (err) { req.destroy() }
+ function onerror (err) {
+ var res = bounce.respond();
+ res.statusCode = 500;
+ res.end('error\r\n');
+ }
if (typeof route === 'string') {
var s = route.split(':');

0 comments on commit 88425dc

Please sign in to comment.