mirror of
https://github.com/overleaf/overleaf.git
synced 2024-10-31 21:21:03 -04:00
14 lines
465 B
CoffeeScript
14 lines
465 B
CoffeeScript
app = angular.module 'ErrorCatcher', []
|
|
|
|
app.config ['$provide', ($provide) ->
|
|
$provide.decorator '$exceptionHandler', ['$log', '$delegate', ($log, $delegate) ->
|
|
return (exception, cause) ->
|
|
if (Raven?.captureException?)
|
|
Raven.captureException exception;
|
|
$delegate(exception, cause)
|
|
]
|
|
]
|
|
|
|
# TODO: add support for an errorHttpInterceptor to catch failing ajax
|
|
# requests as described at
|
|
# http://bahmutov.calepin.co/catch-all-errors-in-angular-app.html
|