From b13a6c1b6450266f480953f1b7f53225738965f5 Mon Sep 17 00:00:00 2001 From: analog-nico Date: Fri, 20 Mar 2015 12:24:09 -0400 Subject: [PATCH] Update as discussed in pull request #40 --- README.md | 3 +++ lib/errors.js | 12 ++++-------- package.json | 2 +- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 854a13f..d384e6f 100644 --- a/README.md +++ b/README.md @@ -397,6 +397,9 @@ If you want to debug a test you should use `gulp test-without-coverage` to run a ### Main Branch +- v0.4.1 (2015-03-20) + - Improved Error types to work in browsers without v8 engine + *(Thanks to @nodiis for [pull request #40](https://github.com/tyabonil/request-promise/pull/40))* - v0.4.0 (2015-02-08) - Introduced Error types used for the reject reasons (See last part [this section](#rejected-promises-and-the-simple-option)) *(Thanks to @jakecraige for starting the discussion in [issue #38](https://github.com/tyabonil/request-promise/issues/38))* diff --git a/lib/errors.js b/lib/errors.js index dbd66fc..2ad8ada 100644 --- a/lib/errors.js +++ b/lib/errors.js @@ -7,10 +7,8 @@ function RequestError(cause) { this.message = String(cause); this.cause = cause; - if(Error.captureStackTrace){ - Error.captureStackTrace(this); - } else { - Error.call(this); + if (Error.captureStackTrace) { + Error.captureStackTrace(this); } } @@ -24,10 +22,8 @@ function StatusCodeError(statusCode, message) { this.statusCode = statusCode; this.message = statusCode + ' - ' + message; - if(Error.captureStackTrace){ - Error.captureStackTrace(this); - } else { - Error.call(this); + if (Error.captureStackTrace) { + Error.captureStackTrace(this); } } diff --git a/package.json b/package.json index a523b02..360d4fe 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "request-promise", - "version": "0.4.0", + "version": "0.4.1", "description": "The world-famous HTTP client 'Request' now Promises/A+ compliant. Powered by Bluebird.", "keywords": [ "xhr",