Permalink
Browse files

If someone makes a request with garbage, and parsing fails, the CLI t…

…ool would not catch the error and crash. That's not a nice thing to do, so now just destroy the request.
  • Loading branch information...
1 parent 3263b71 commit 26412d586cbb5023e6256c2384828bde11886f1a @yorickvP yorickvP committed Dec 10, 2011
Showing with 4 additions and 0 deletions.
  1. +4 −0 bin/bouncy.js
View
@@ -20,6 +20,10 @@ bouncy(function (req, bounce) {
route = route[Math.floor(Math.random() * route.length)];
}
+ req.on('error', function(err) {
+ req.destroy();
+ });
+
if (typeof route === 'string') {
var s = route.split(':');
if (s[1]) {

0 comments on commit 26412d5

Please sign in to comment.