aboutsummaryrefslogtreecommitdiff
path: root/node_modules/node-fetch
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2017-12-10 21:51:33 +0100
committerFlorian Dold <florian.dold@gmail.com>2017-12-10 21:51:33 +0100
commit0469abd4a9c9270a1fdc962969e36e63699af8b4 (patch)
treef9864d4a4148621378958794cbbfdc2393733283 /node_modules/node-fetch
parent6947e79bbc258f7bc96af424ddb71a511f0c15a3 (diff)
upgrade dependencies
Diffstat (limited to 'node_modules/node-fetch')
-rw-r--r--node_modules/node-fetch/CHANGELOG.md4
-rw-r--r--node_modules/node-fetch/lib/fetch-error.js5
-rw-r--r--node_modules/node-fetch/package.json2
-rw-r--r--node_modules/node-fetch/test/test.js4
4 files changed, 10 insertions, 5 deletions
diff --git a/node_modules/node-fetch/CHANGELOG.md b/node_modules/node-fetch/CHANGELOG.md
index ea8ebe71c..e298b1b11 100644
--- a/node_modules/node-fetch/CHANGELOG.md
+++ b/node_modules/node-fetch/CHANGELOG.md
@@ -7,6 +7,10 @@ Changelog
(Note: `1.x` will only have backported bugfix releases beyond `1.7.0`)
+## v1.7.3
+
+- Enhance: `FetchError` now gives a correct trace stack (backport from v2.x relese).
+
## v1.7.2
- Fix: when using node-fetch with test framework such as `jest`, `instanceof` check could fail in `Headers` class. This is causing some header values, such as `set-cookie`, to be dropped incorrectly.
diff --git a/node_modules/node-fetch/lib/fetch-error.js b/node_modules/node-fetch/lib/fetch-error.js
index 7cabfb3ce..a48eb828c 100644
--- a/node_modules/node-fetch/lib/fetch-error.js
+++ b/node_modules/node-fetch/lib/fetch-error.js
@@ -17,9 +17,6 @@ module.exports = FetchError;
*/
function FetchError(message, type, systemError) {
- // hide custom error implementation details from end-users
- Error.captureStackTrace(this, this.constructor);
-
this.name = this.constructor.name;
this.message = message;
this.type = type;
@@ -29,6 +26,8 @@ function FetchError(message, type, systemError) {
this.code = this.errno = systemError.code;
}
+ // hide custom error implementation details from end-users
+ Error.captureStackTrace(this, this.constructor);
}
require('util').inherits(FetchError, Error);
diff --git a/node_modules/node-fetch/package.json b/node_modules/node-fetch/package.json
index 892b93068..6bf8e40e8 100644
--- a/node_modules/node-fetch/package.json
+++ b/node_modules/node-fetch/package.json
@@ -1,6 +1,6 @@
{
"name": "node-fetch",
- "version": "1.7.2",
+ "version": "1.7.3",
"description": "A light-weight module that brings window.fetch to node.js and io.js",
"main": "index.js",
"scripts": {
diff --git a/node_modules/node-fetch/test/test.js b/node_modules/node-fetch/test/test.js
index 284b263a9..d1bd3fd4e 100644
--- a/node_modules/node-fetch/test/test.js
+++ b/node_modules/node-fetch/test/test.js
@@ -1458,7 +1458,7 @@ describe('node-fetch', function() {
expect(body).to.have.property('buffer');
});
- it('should create custom FetchError', function() {
+ it('should create custom FetchError', function funcName() {
var systemError = new Error('system');
systemError.code = 'ESOMEERROR';
@@ -1470,6 +1470,8 @@ describe('node-fetch', function() {
expect(err.type).to.equal('test-error');
expect(err.code).to.equal('ESOMEERROR');
expect(err.errno).to.equal('ESOMEERROR');
+ expect(err.stack).to.include('funcName');
+ expect(err.stack.split('\n')[0]).to.equal(err.name + ': ' + err.message);
});
it('should support https request', function() {