diff --git a/src/helpers/grid.ts b/src/helpers/grid.ts index 7e7a8e6..f928e76 100644 --- a/src/helpers/grid.ts +++ b/src/helpers/grid.ts @@ -3,7 +3,6 @@ import Vector3 from "./Vector3"; import Vector2 from "./Vector2"; import Size from "./Size"; -import { logError } from "./logging"; import { Grid, GridInset, GridScale } from "../types/Grid"; const SQRT3 = 1.73205; @@ -562,8 +561,8 @@ export async function getGridSizeFromImage(image: HTMLImageElement) { try { prediction = await gridSizeML(image, candidates); } catch (error) { - if (error instanceof Error) { - logError(error); + if (error instanceof Error) { + console.error(error); } } diff --git a/src/helpers/logging.ts b/src/helpers/logging.ts deleted file mode 100644 index b7c9a75..0000000 --- a/src/helpers/logging.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { captureException } from "@sentry/react"; - -export function logError(error: Error): void { - console.error(error); - if (process.env.REACT_APP_LOGGING === "true") { - captureException(error); - } -} diff --git a/src/index.tsx b/src/index.tsx index 8c865ae..13b71fe 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -1,6 +1,4 @@ import ReactDOM from "react-dom"; -import * as Sentry from "@sentry/react"; -import { Dedupe } from "@sentry/integrations"; import App from "./App"; import Modal from "react-modal"; @@ -21,73 +19,6 @@ if (!("IntersectionObserver" in window)) { import("intersection-observer"); } -if (process.env.REACT_APP_LOGGING === "true") { - Sentry.init({ - dsn: process.env.REACT_APP_SENTRY_DSN, - release: "owlbear-rodeo@" + process.env.REACT_APP_VERSION, - integrations: [new Dedupe()], - // Ignore resize error as it is triggered by going fullscreen on slower computers - // Ignore quota error - // Ignore XDR encoding failure bug in Firefox https://bugzilla.mozilla.org/show_bug.cgi?id=1678243 - // Ignore LastPass extension text error - // Ignore chrome extension error - // Ignore dexie error todo: fix - ignoreErrors: [ - "ResizeObserver loop limit exceeded", - "ResizeObserver loop completed with undelivered notifications", - // Konva error with FireFox 78 - "CanvasPattern.setTransform: Argument 1 does not implement interface SVGMatrix", - "QuotaExceededError", - "DatabaseClosedError", - "XDR encoding failure", - "Assertion failed: Input argument is not an HTMLInputElement", - "Extension context invalidated", - new RegExp( - "([InvalidStateError:\\s]*Failed to execute 'transaction' on 'IDBDatabase': The database connection is closing([.]*[\\s]*))+" - ), - "Browser is shutting down", - "An internal error was encountered in the Indexed Database server", - // Random plugins/extensions - "top.GLOBALS", - // See: http://blog.errorception.com/2012/03/tale-of-unfindable-js-error.html - "originalCreateNotification", - "canvas.contentDocument", - "MyApp_RemoveAllHighlights", - "http://tt.epicplay.com", - "Can't find variable: ZiteReader", - "jigsaw is not defined", - "ComboSearch is not defined", - "http://loading.retry.widdit.com/", - "atomicFindClose", - // Facebook borked - "fb_xd_fragment", - // ISP "optimizing" proxy - `Cache-Control: no-transform` seems to - // reduce this. (thanks @acdha) - // See http://stackoverflow.com/questions/4113268 - "bmi_SafeAddOnload", - "EBCallBackMessageReceived", - // See http://toolbar.conduit.com/Developer/HtmlAndGadget/Methods/JSInjection.aspx - "conduitPage", - ], - denyUrls: [ - // Facebook flakiness - /graph\.facebook\.com/i, - // Facebook blocked - /connect\.facebook\.net\/en_US\/all\.js/i, - // Woopra flakiness - /eatdifferent\.com\.woopra-ns\.com/i, - /static\.woopra\.com\/js\/woopra\.js/i, - // Chrome extensions - /extensions\//i, - /^chrome:\/\//i, - // Other plugins - /127\.0\.0\.1:4001\/isrunning/i, // Cacaoweb - /webappstoolbarba\.texthelp\.com\//i, - /metrics\.itunes\.apple\.com\.edgesuite\.net\//i, - ], - }); -} - Modal.setAppElement("#root"); ReactDOM.render(, document.getElementById("root")); diff --git a/src/network/Session.ts b/src/network/Session.ts index 6011dbb..c112df5 100644 --- a/src/network/Session.ts +++ b/src/network/Session.ts @@ -5,7 +5,6 @@ import { EventEmitter } from "events"; import Connection, { DataProgressEvent } from "./Connection"; import { omit } from "../helpers/shared"; -import { logError } from "../helpers/logging"; import { SignalData } from "simple-peer"; /** @@ -95,7 +94,6 @@ class Session extends EventEmitter { this.emit("status", "ready"); } catch (error: any) { - logError(error); this.emit("status", "offline"); } } @@ -309,7 +307,6 @@ class Session extends EventEmitter { return true; } catch (error: any) { - logError(error); this.emit("peerError", { error }); for (let peer of Object.values(this.peers)) { peer.connection && peer.connection.destroy(); diff --git a/src/routes/Donate.tsx b/src/routes/Donate.tsx index 718a1a0..2470764 100644 --- a/src/routes/Donate.tsx +++ b/src/routes/Donate.tsx @@ -15,7 +15,6 @@ import Footer from "../components/Footer"; import ErrorBanner from "../components/banner/ErrorBanner"; import LoadingOverlay from "../components/LoadingOverlay"; -import { logError } from "../helpers/logging"; import { Stripe } from "@stripe/stripe-js"; type Price = { price?: string; name: string; value: number }; @@ -45,7 +44,6 @@ function Donate() { } }) .catch((error) => { - logError(error); // TODO: check setError -> cannot work with value as a string setError(error.message); setLoading(false);