Selaa lähdekoodia

Enabled error handling for window object

jnfrati 4 vuotta sitten
vanhempi
sitoutus
708c45ff6b
1 muutettua tiedostoa jossa 3 lisäystä ja 6 poistoa
  1. 3 6
      dashboard/src/index.tsx

+ 3 - 6
dashboard/src/index.tsx

@@ -4,7 +4,8 @@ import "regenerator-runtime/runtime";
 import * as React from "react";
 import * as ReactDOM from "react-dom";
 import App from "./App";
-import { SetupSentry } from "shared/sentry/setup";
+import { SetupSentry } from "shared/error_handling/sentry/setup";
+import { EnableErrorHandling } from "shared/error_handling/window_error_handling";
 
 declare global {
   interface Window {
@@ -15,10 +16,6 @@ if (process.env.ENABLE_SENTRY) {
   SetupSentry();
 }
 
-function EnableErrorHandling() {
-  window.onerror = function (msg, file, line, col, error) {
-    StackTrace.fromError(error).then((err) => {});
-  };
-}
+EnableErrorHandling();
 
 ReactDOM.render(<App />, document.getElementById("output"));