Merge pull request #1169 from sharelatex/pr-ignore-unhandled-rejection-error

Ignore unhandled rejection error globally

GitOrigin-RevId: 29574973e78f44caeb965b70b3dc43681275e05d
This commit is contained in:
Paulo Jorge Reis 2018-11-22 10:55:10 +00:00 committed by sharelatex
parent c20a506f0e
commit 80dde39e56

View file

@ -11,6 +11,7 @@
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
*/
const app = angular.module('ErrorCatcher', [])
const UNHANDLED_REJECTION_ERR_MSG = 'Possibly unhandled rejection: canceled'
app.config([
'$provide',
@ -20,6 +21,12 @@ app.config([
'$delegate',
($log, $delegate) =>
function(exception, cause) {
if (
exception === UNHANDLED_REJECTION_ERR_MSG &&
cause === undefined
) {
return
}
if (
(typeof Raven !== 'undefined' && Raven !== null
? Raven.captureException