Browse Source

Add `err.url` to match `res.url`

master
Forbes Lindesay 9 years ago
parent
commit
92f59d344b
  1. 2
      index.js

2
index.js

@ -8,6 +8,7 @@ module.exports = Response;
* @param {Number} statusCode
* @param {Object} headers
* @param {Buffer} body
* @param {String} url
*/
function Response(statusCode, headers, body, url) {
if (typeof statusCode !== 'number') {
@ -35,6 +36,7 @@ Response.prototype.getBody = function (encoding) {
err.statusCode = this.statusCode;
err.headers = this.headers;
err.body = this.body;
err.url = this.url;
throw err;
}
return encoding ? this.body.toString(encoding) : this.body;

Loading…
Cancel
Save