Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit 257a3f3

Browse files
gkalpakIgorMinar
authored andcommitted
docs($exceptionHandler): add a note about cases when exceptions are not delegated to the
$exceptionHandler Add a note in $exceptionHandler's documentation about cases when exceptions are not delegated to the $exceptionHandler, because they are executed outside of the Angular context. Most notable such cases being the DOM event listeners registered using jqLite's/jQuery's on/bind methods. Closes #7909 Closes #9318
1 parent 2230fb4 commit 257a3f3

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/ng/exceptionHandler.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,14 @@
2727
* This example will override the normal action of `$exceptionHandler`, to make angular
2828
* exceptions fail hard when they happen, instead of just logging to the console.
2929
*
30+
* <hr />
31+
* Note, that code executed in event-listeners (even those registered using jqLite's `on`/`bind`
32+
* methods) does not delegate exceptions to the {@link ng.$exceptionHandler $exceptionHandler}
33+
* (unless executed during a digest).
34+
*
35+
* If you wish, you can manually delegate exceptions, e.g.
36+
* `try { ... } catch(e) { $exceptionHandler(e); }`
37+
*
3038
* @param {Error} exception Exception associated with the error.
3139
* @param {string=} cause optional information about the context in which
3240
* the error was thrown.

0 commit comments

Comments
 (0)