Comparing version 6.1.2 to 6.2.0
@@ -108,3 +108,3 @@ 'use strict'; | ||
} catch (e) { | ||
throw new got.ParseError(e, opts, data); | ||
throw new got.ParseError(e, statusCode, opts, data); | ||
} | ||
@@ -322,4 +322,6 @@ } | ||
got.ReadError = createErrorClass('ReadError', stdError); | ||
got.ParseError = createErrorClass('ParseError', function (e, opts, data) { | ||
got.ParseError = createErrorClass('ParseError', function (e, statusCode, opts, data) { | ||
stdError.call(this, e, opts); | ||
this.statusCode = statusCode; | ||
this.statusMessage = nodeStatusCodes[this.statusCode]; | ||
this.message = `${e.message} in "${urlLib.format(opts)}": \n${data.slice(0, 77)}...`; | ||
@@ -326,0 +328,0 @@ }); |
{ | ||
"name": "got", | ||
"version": "6.1.2", | ||
"version": "6.2.0", | ||
"description": "Simplified HTTP/HTTPS requests", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@@ -167,3 +167,3 @@ <h1 align="center"> | ||
Each error contains (if available) `host`, `hostname`, `method` and `path` properties to make debugging easier. | ||
Each error contains (if available) `statusCode`, `statusMessage`, `host`, `hostname`, `method` and `path` properties to make debugging easier. | ||
@@ -170,0 +170,0 @@ In Promise mode, the `response` is attached to the error. |
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
19163
267