Skip to content
Browse files

better error handler for the cli tool

  • Loading branch information...
1 parent e36877f commit 88425dcb050e66ec0d003c2a6599e9d91cbb71e5 @substack substack committed
Showing with 5 additions and 1 deletion.
  1. +5 −1 bin/bouncy.js
View
6 bin/bouncy.js
@@ -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.
Something went wrong with that request. Please try again.