From 07c11c03cc7f6d182eab9b50e2f3908ee397f70f Mon Sep 17 00:00:00 2001 From: Dave Methvin Date: Tue, 10 May 2016 21:50:00 -0400 Subject: Deferred: Give better stack diagnostics on exceptions Ref gh-2736 The exception stack has the name of the immediately outer function where the exception occurred, which can be very handy for tracing errors. Since we already have the exception object we might as well use it. --- src/deferred/exceptionHook.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/deferred/exceptionHook.js b/src/deferred/exceptionHook.js index 7d4a296f4..6dbdc8520 100644 --- a/src/deferred/exceptionHook.js +++ b/src/deferred/exceptionHook.js @@ -14,7 +14,7 @@ jQuery.Deferred.exceptionHook = function( error, stack ) { // Support: IE 8 - 9 only // Console exists when dev tools are open, which can happen at any time if ( window.console && window.console.warn && error && rerrorNames.test( error.name ) ) { - window.console.warn( "jQuery.Deferred exception: " + error.message, stack ); + window.console.warn( "jQuery.Deferred exception: " + error.message, error.stack, stack ); } }; -- cgit v1.2.3