Recommended practice for application exception handling in AngularJS

后端 未结 3 774
遥遥无期
遥遥无期 2021-01-31 03:42

I am currently exploring possible methods to handle application-wide exceptions in AngularJS.

One of the things we really wanted to avoid was wrapping multiple parts of

3条回答
  •  遥遥无期
    2021-01-31 03:46

    You can override the $exceptionHandler in order to pass the exceptions to your own central service for exceptions, but the $exceptionHandler seems to only receive the exceptions thrown from your controllers, directives, etc... but not for the exceptions originated from ajax calls. For those exceptions you can implement an interceptor like the one described in this page:

    EDITED: Link is dead permanently.
    Archive.org link

提交回复
热议问题