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

Commit f2a5402

Browse files
committed
docs($exceptionHandler): shorten note about exception-handling in event callbacks
1 parent 251ba2d commit f2a5402

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

src/ng/exceptionHandler.js

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,12 @@
2828
* exceptions fail hard when they happen, instead of just logging to the console.
2929
*
3030
* <hr />
31-
* Note, that code executed outside of the Angular context does not delegate exceptions to the
32-
* {@link ng.$exceptionHandler $exceptionHandler}. Some common such cases include functions invoked
33-
* by third party libraries and callbacks associated with XHR, setTimeout/setInterval and browser
34-
* DOM events (including callbacks registered using jqLite's/jQuery's `on`/`bind` methods).
35-
* For some of those cases, Angular provides native wrappers that transparently manage the $digest
36-
* cycle and delegate exceptions to the {@link ng.$exceptionHandler $exceptionHandler} (e.g.
37-
* {@link ng.$http $http} for XHR, {@link ng.$timeout $timeout}/{@link ng.$interval $interval} for
38-
* setTimeout/setInterval). For the rest, you can explicitly ensure that the code is excecuted
39-
* inside of the Angular context, by wrapping it in
40-
* {@link ng.$rootScope.Scope#$apply scope.$apply()}.
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); }`
4137
*
4238
* @param {Error} exception Exception associated with the error.
4339
* @param {string=} cause optional information about the context in which

0 commit comments

Comments
 (0)