From ab1c4090229c470ca81db5e02a30836f3d9277a6 Mon Sep 17 00:00:00 2001 From: Vahe Hovhannisyan Date: Thu, 26 Sep 2013 11:56:11 -0700 Subject: [PATCH] Fix stack trace bug on safari --- src/js/ripple/rippleerror.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/js/ripple/rippleerror.js b/src/js/ripple/rippleerror.js index 30fbf780..469afc47 100644 --- a/src/js/ripple/rippleerror.js +++ b/src/js/ripple/rippleerror.js @@ -16,7 +16,11 @@ function RippleError(code, message) { this.result_message = this.result_message || this.error_message || 'Error'; this.message = this.result_message; - Error.captureStackTrace(this, code || this); + var stack; + if (!!Error.captureStackTrace) + Error.captureStackTrace(this, code || this); + else if (stack = new Error().stack) + this.stack = stack; } util.inherits(RippleError, Error);