http2-wrapper
Advanced tools
Comparing version 2.1.11 to 2.2.0
{ | ||
"name": "http2-wrapper", | ||
"version": "2.1.11", | ||
"version": "2.2.0", | ||
"description": "HTTP2 client, just with the familiar `https` API", | ||
@@ -5,0 +5,0 @@ "main": "source", |
@@ -427,2 +427,4 @@ 'use strict'; | ||
this[kJobs].length = 0; | ||
this.emit('socket', this.socket); | ||
@@ -429,0 +431,0 @@ }; |
@@ -29,3 +29,3 @@ 'use strict'; | ||
if (statusCode !== 200) { | ||
callback(new UnexpectedStatusCodeError(statusCode)); | ||
callback(new UnexpectedStatusCodeError(statusCode, '')); | ||
return; | ||
@@ -32,0 +32,0 @@ } |
@@ -12,3 +12,3 @@ 'use strict'; | ||
request.off('error', reject); | ||
resolve([socket, response.statusCode]); | ||
resolve([socket, response.statusCode, response.statusMessage]); | ||
}; | ||
@@ -15,0 +15,0 @@ |
@@ -28,3 +28,3 @@ 'use strict'; | ||
return [stream, statusCode]; | ||
return [stream, statusCode, '']; | ||
} | ||
@@ -31,0 +31,0 @@ } |
@@ -17,5 +17,5 @@ 'use strict'; | ||
const [stream, statusCode] = await this._getProxyStream(authority); | ||
const [stream, statusCode, statusMessage] = await this._getProxyStream(authority); | ||
if (statusCode !== 200) { | ||
throw new UnexpectedStatusCodeError(statusCode); | ||
throw new UnexpectedStatusCodeError(statusCode, statusMessage); | ||
} | ||
@@ -22,0 +22,0 @@ |
'use strict'; | ||
class UnexpectedStatusCodeError extends Error { | ||
constructor(statusCode) { | ||
super(`The proxy server rejected the request with status code ${statusCode}`); | ||
constructor(statusCode, statusMessage = '') { | ||
super(`The proxy server rejected the request with status code ${statusCode} (${statusMessage || 'empty status message'})`); | ||
this.statusCode = statusCode; | ||
this.statusMessage = statusMessage; | ||
} | ||
@@ -8,0 +9,0 @@ } |
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
75301
1893
1