mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05: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
|