errorCatcher.coffee 465 B

1234567891011121314
  1. app = angular.module 'ErrorCatcher', []
  2. app.config ['$provide', ($provide) ->
  3. $provide.decorator '$exceptionHandler', ['$log', '$delegate', ($log, $delegate) ->
  4. return (exception, cause) ->
  5. if (Raven?.captureException?)
  6. Raven.captureException exception;
  7. $delegate(exception, cause)
  8. ]
  9. ]
  10. # TODO: add support for an errorHttpInterceptor to catch failing ajax
  11. # requests as described at
  12. # http://bahmutov.calepin.co/catch-all-errors-in-angular-app.html