aboutsummaryrefslogtreecommitdiffstats
path: root/src/deferred/exceptionHook.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/deferred/exceptionHook.js')
-rw-r--r--src/deferred/exceptionHook.js7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/deferred/exceptionHook.js b/src/deferred/exceptionHook.js
index 0315b2ecb..a5e7b5d3c 100644
--- a/src/deferred/exceptionHook.js
+++ b/src/deferred/exceptionHook.js
@@ -6,13 +6,16 @@ import "../deferred.js";
// warn about them ASAP rather than swallowing them by default.
var rerrorNames = /^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;
-jQuery.Deferred.exceptionHook = function( error, stack ) {
+// If `jQuery.Deferred.getErrorHook` is defined, `asyncError` is an error
+// captured before the async barrier to get the original error cause
+// which may otherwise be hidden.
+jQuery.Deferred.exceptionHook = function( error, asyncError ) {
if ( error && rerrorNames.test( error.name ) ) {
window.console.warn(
"jQuery.Deferred exception",
error,
- stack
+ asyncError
);
}
};