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

docs($exceptionHandler): add a note about cases when exceptions are not delegated... #9318

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/ng/exceptionHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,14 @@
* This example will override the normal action of `$exceptionHandler`, to make angular
* exceptions fail hard when they happen, instead of just logging to the console.
*
* <hr />

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps add in the detail from @gkalpak that anything executed outside the AJS context will run into this issue...here's my quick edit:

Note, code executed outside of the Angular context, most commonly DOM event listeners (even those registered using jqLite's on/bind methods), will not delegate exceptions to the {@link ng.$exceptionHandler $exceptionHandler} (unless executed during a digest).

* Note, that code executed in event-listeners (even those registered using jqLite's `on`/`bind`
* methods) does not delegate exceptions to the {@link ng.$exceptionHandler $exceptionHandler}
* (unless executed during a digest).
*
* If you wish, you can manually delegate exceptions, e.g.
* `try { ... } catch(e) { $exceptionHandler(e); }`
*
* @param {Error} exception Exception associated with the error.
* @param {string=} cause optional information about the context in which
* the error was thrown.
Expand Down