Comparing version 11.0.0 to 12.0.0
@@ -218,6 +218,2 @@ 'use strict'; | ||
if (!err && res.statusCode >= 400) { | ||
err = Boom.create(res.statusCode, res.statusMessage); | ||
} | ||
if (err) { | ||
@@ -528,2 +524,10 @@ req.abort(); | ||
if (!err && res.statusCode >= 400) { | ||
return callback(Boom.create(res.statusCode, 'Response Error: ' + res.statusMessage, { | ||
isResponseError: true, | ||
headers: res.headers, | ||
payload | ||
})); | ||
} | ||
return callback(err, res, payload); | ||
@@ -530,0 +534,0 @@ }); |
{ | ||
"name": "wreck", | ||
"description": "HTTP Client Utilities", | ||
"version": "11.0.0", | ||
"version": "12.0.0", | ||
"repository": "git://github.com/hapijs/wreck", | ||
@@ -6,0 +6,0 @@ "main": "lib/index", |
@@ -122,3 +122,3 @@ ![wreck Logo](https://raw.github.com/hapijs/wreck/master/images/wreck.png) | ||
- `callback` - The optional callback function using the signature `function (err, response)` where: | ||
- `err` - Any error that may have occurred during the handling of the request or a Boom error object if the response has an error status code. | ||
- `err` - Any error that may have occurred during the handling of the request. | ||
- `response` - The [HTTP Incoming Message](http://nodejs.org/api/http.html#http_http_incomingmessage) | ||
@@ -151,3 +151,6 @@ object, which is also a readable stream. | ||
- `callback` - The callback function using the signature `function (err, response, payload)` where: | ||
- `err` - Any error that may have occurred during handling of the request or a Boom error object if the response has an error status code. | ||
- `err` - Any error that may have occurred during handling of the request or a Boom error object if the response has an error status code. If the error is a boom error object it will have the following properties in addition to the standard boom properties. | ||
- `data.isResponseError` - boolean, indicates if the error is a result of an error response status code | ||
- `data.headers` - object containing the response headers | ||
- `data.payload` - the payload in the form of a Buffer or as a parsed object | ||
- `response` - The [HTTP Incoming Message](http://nodejs.org/api/http.html#http_http_incomingmessage) | ||
@@ -167,3 +170,6 @@ object, which is a readable stream that has "ended" and contains no more data to read. | ||
- `callback` - The callback function using the signature `function (err, response, payload)` where: | ||
- `err` - Any error that may have occurred during handling of the request or a Boom error object if the response has an error status code. | ||
- `err` - Any error that may have occurred during handling of the request or a Boom error object if the response has an error status code. If the error is a boom error object it will have the following properties in addition to the standard boom properties. | ||
- `data.isResponseError` - boolean, indicates if the error is a result of an error response status code | ||
- `data.headers` - object containing the response headers | ||
- `data.payload` - the payload in the form of a Buffer or as a parsed object | ||
- `response` - The [HTTP Incoming Message](http://nodejs.org/api/http.html#http_http_incomingmessage) | ||
@@ -182,3 +188,6 @@ object, which is a readable stream that has "ended" and contains no more data to read. | ||
- `callback` - The callback function using the signature `function (err, response, payload)` where: | ||
- `err` - Any error that may have occurred during handling of the request or a Boom error object if the response has an error status code. | ||
- `err` - Any error that may have occurred during handling of the request or a Boom error object if the response has an error status code. If the error is a boom error object it will have the following properties in addition to the standard boom properties. | ||
- `data.isResponseError` - boolean, indicates if the error is a result of an error response status code | ||
- `data.headers` - object containing the response headers | ||
- `data.payload` - the payload in the form of a Buffer or as a parsed object | ||
- `response` - The [HTTP Incoming Message](http://nodejs.org/api/http.html#http_http_incomingmessage) | ||
@@ -198,3 +207,6 @@ object, which is a readable stream that has "ended" and contains no more data to read. | ||
- `callback` - The callback function using the signature `function (err, response, payload)` where: | ||
- `err` - Any error that may have occurred during handling of the request or a Boom error object if the response has an error status code. | ||
- `err` - Any error that may have occurred during handling of the request or a Boom error object if the response has an error status code. If the error is a boom error object it will have the following properties in addition to the standard boom properties. | ||
- `data.isResponseError` - boolean, indicates if the error is a result of an error response status code | ||
- `data.headers` - object containing the response headers | ||
- `data.payload` - the payload in the form of a Buffer or as a parsed object | ||
- `response` - The [HTTP Incoming Message](http://nodejs.org/api/http.html#http_http_incomingmessage) | ||
@@ -214,3 +226,6 @@ object, which is a readable stream that has "ended" and contains no more data to read. | ||
- `callback` - The callback function using the signature `function (err, response, payload)` where: | ||
- `err` - Any error that may have occurred during handling of the request or a Boom error object if the response has an error status code. | ||
- `err` - Any error that may have occurred during handling of the request or a Boom error object if the response has an error status code. If the error is a boom error object it will have the following properties in addition to the standard boom properties. | ||
- `data.isResponseError` - boolean, indicates if the error is a result of an error response status code | ||
- `data.headers` - object containing the response headers | ||
- `data.payload` - the payload in the form of a Buffer or as a parsed object | ||
- `response` - The [HTTP Incoming Message](http://nodejs.org/api/http.html#http_http_incomingmessage) | ||
@@ -217,0 +232,0 @@ object, which is a readable stream that has "ended" and contains no more data to read. |
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
37888
448
341