Преглед изворни кода

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

Ignore unhandled rejection error globally

GitOrigin-RevId: 29574973e78f44caeb965b70b3dc43681275e05d
Paulo Jorge Reis пре 8 година
родитељ
комит
80dde39e56
1 измењених фајлова са 7 додато и 0 уклоњено
  1. 7 0
      services/web/public/src/modules/errorCatcher.js

+ 7 - 0
services/web/public/src/modules/errorCatcher.js

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