Fix stack trace bug on safari

This commit is contained in:
Vahe Hovhannisyan
2013-09-26 11:56:11 -07:00
parent bf940fdec5
commit ab1c409022

View File

@@ -16,7 +16,11 @@ function RippleError(code, message) {
this.result_message = this.result_message || this.error_message || 'Error'; this.result_message = this.result_message || this.error_message || 'Error';
this.message = this.result_message; 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); util.inherits(RippleError, Error);