jQuery.Deferred.exceptionHook()Returns: Error
Description: Handle errors produced by Deferreds.
-
version added: 3.0jQuery.Deferred.exceptionHook()
- This method does not accept any arguments.
This API is called every time an error is thrown inside Deferreds. By default, it only warns about errors that are more likely to be programmer errors than errors thrown due to application logic. This includes errors like SyntaxError
or ReferenceError
.
The function accepts two parameters - the first one is the error thrown and the second, optional parameter is a "fake" error created before the handler is called so that a stack trace from before an async barrier is available. This second error is only provided if jQuery.Deferred.getErrorHook
is defined; see the docs for that API for more details.
Example
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
|