Comparing version 1.0.0 to 2.0.0
@@ -6,5 +6,7 @@ 'use strict'; | ||
var host = req._headers ? (' to ' + req._headers.host) : ''; | ||
req.timeoutTimer = setTimeout(function timeoutHandler() { | ||
req.abort(); | ||
var e = new Error('ETIMEDOUT'); | ||
var e = new Error('Connection timed out on request' + host); | ||
e.code = 'ETIMEDOUT'; | ||
@@ -18,3 +20,3 @@ req.emit('error', e); | ||
req.abort(); | ||
var e = new Error('ESOCKETTIMEDOUT'); | ||
var e = new Error('Socket timed out on request' + host); | ||
e.code = 'ESOCKETTIMEDOUT'; | ||
@@ -21,0 +23,0 @@ req.emit('error', e); |
{ | ||
"name": "timed-out", | ||
"version": "1.0.0", | ||
"version": "2.0.0", | ||
"description": "Emit `ETIMEDOUT` or `ESOCKETTIMEDOUT` when ClientRequest is hanged", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@@ -5,3 +5,3 @@ # timed-out [![Build Status](https://travis-ci.org/floatdrop/timed-out.svg?branch=master)](https://travis-ci.org/floatdrop/timed-out) | ||
Emit `ETIMEDOUT` or `ESOCKETTIMEDOUT` when ClientRequest is hanged. | ||
Emit Error object with `code` property equal `ETIMEDOUT` or `ESOCKETTIMEDOUT` when ClientRequest is hanged. | ||
@@ -32,3 +32,3 @@ ## Usage | ||
*Required* | ||
Type: `Number` | ||
Type: `number` | ||
@@ -35,0 +35,0 @@ Time in milliseconds before errors will be emitted and `request.abort()` call happens. |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2233
28