Browse files

Better error handling

  • Loading branch information...
1 parent 99d9fb2 commit 4bc7b4595a54dccfc1f9524817d0c28b7548920f @akaspin committed Nov 19, 2010
Showing with 3 additions and 1 deletion.
  1. +3 −1 http.js
View
4 http.js
@@ -43,7 +43,9 @@ Handler.prototype.next = function() {
};
Handler.prototype.error = function(code, reason) {
- throw new HandlerError(code, reason);
+ var op = this._chain[this._level];
+ var errGen = op['ERROR'] || ERROR;
+ this._handleError(new HandlerError(code, reason), errGen);
};
/**

0 comments on commit 4bc7b45

Please sign in to comment.