You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openwhisk.apache.org by ja...@apache.org on 2018/09/13 07:41:19 UTC

[incubator-openwhisk-client-js] branch master updated: protect against lack of Error.captureStackTrace (#138)

This is an automated email from the ASF dual-hosted git repository.

jamesthomas pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-openwhisk-client-js.git


The following commit(s) were added to refs/heads/master by this push:
     new 0b9e6ce  protect against lack of Error.captureStackTrace (#138)
0b9e6ce is described below

commit 0b9e6ceca5a08d2c67631d98c89377dd14bec27e
Author: Nick Mitchell <st...@users.noreply.github.com>
AuthorDate: Thu Sep 13 03:41:17 2018 -0400

    protect against lack of Error.captureStackTrace (#138)
---
 lib/openwhisk_error.js | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/lib/openwhisk_error.js b/lib/openwhisk_error.js
index 6780726..1bc68f6 100644
--- a/lib/openwhisk_error.js
+++ b/lib/openwhisk_error.js
@@ -4,7 +4,10 @@
 'use strict'
 
 module.exports = function OpenWhiskError (message, error, statusCode) {
-  Error.captureStackTrace(this, this.constructor)
+  if (Error.captureStackTrace) {
+    // this function is not defined in some browsers, notably Firefox
+    Error.captureStackTrace(this, this.constructor)
+  }
   this.name = this.constructor.name
   this.message = message
   this.error = error