Skip to content

Commit

Permalink
Emit a proper error.
Browse files Browse the repository at this point in the history
  • Loading branch information
mikeal committed Aug 12, 2011
1 parent ef767d1 commit 1b12d3a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion main.js
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,9 @@ Request.prototype.request = function () {
if (options.timeout) {
options.timeoutTimer = setTimeout(function() {
options.req.abort()
options.emit("error", "ETIMEDOUT")
var e = new Error("ETIMEDOUT")
e.code = "ETIMEDOUT"
options.emit("error", e)
}, options.timeout)
}

Expand Down

0 comments on commit 1b12d3a

Please sign in to comment.