Permalink
Browse files

t.error() convenience method to fire the errCb

  • Loading branch information...
1 parent 2c7aa18 commit 7b72f9e3d9bfe2f18b739917c51256b57132623f @substack committed Jan 14, 2012
Showing with 5 additions and 0 deletions.
  1. +5 −0 index.js
View
5 index.js
@@ -43,6 +43,11 @@ module.exports = function (outerTimeout, errCb) {
}
};
+ self.error = function (err) {
+ self.end();
+ if (errCb) errCb(err);
+ };
+
self.end = function () {
alive = false;
};

0 comments on commit 7b72f9e

Please sign in to comment.