From 92f59d344ba24e4fbd13c3f385e25eaa70a1f375 Mon Sep 17 00:00:00 2001 From: Forbes Lindesay Date: Thu, 15 Oct 2015 10:51:37 +0100 Subject: [PATCH] Add `err.url` to match `res.url` --- index.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/index.js b/index.js index 799fa8b..70542d4 100644 --- a/index.js +++ b/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;