mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Add process.type to be used by Sentry
Signed-off-by: Hung-Han (Henry) Chen <chenhungh@gmail.com>
This commit is contained in:
3 files changed
+27
-1
No files matched your search
@@ -36,6 +36,25 @@ import { registerIpcHandlers } from "./ipc";
|
||||
import { ipcRenderer } from "electron";
|
||||
import { IpcRendererNavigationEvents } from "./navigation/events";
|
||||
import { catalogEntityRegistry } from "./api/catalog-entity-registry";
|
||||
import { dsn } from "../common/vars";
|
||||
import { CaptureConsole, Dedupe, Offline } from "@sentry/integrations";
|
||||
|
||||
// Initializing Sentry
|
||||
const Sentry =
|
||||
// prevent `TypeError: mod.require is not a function`
|
||||
// see https://docs.sentry.io/platforms/javascript/guides/electron/#webpack-configuration
|
||||
process.type === "main"
|
||||
? require("@sentry/electron/dist/main")
|
||||
: require("@sentry/electron/dist/renderer");
|
||||
|
||||
Sentry.init({
|
||||
dsn,
|
||||
integrations: [
|
||||
new CaptureConsole({ levels: ["error"] }),
|
||||
new Dedupe(),
|
||||
new Offline()
|
||||
],
|
||||
});
|
||||
|
||||
@observer
|
||||
export class LensApp extends React.Component {
|
||||
|
||||
Reference in new issue
Block a user