Bump all @sentry related packages (#5155)

This commit is contained in:
Sebastian Malton authored and GitHub committed 2022-04-01 08:55:34 -04:00
1 parent 8e8ad6663b
commit 7fffa3643c
5 files changed
+105 -149

No files matched your search

+8 -3
View File
@@ -4,10 +4,11 @@
*/
import { Dedupe, Offline } from "@sentry/integrations";
import * as Sentry from "@sentry/electron";
import { sentryDsn, isProduction } from "./vars";
import { UserStore } from "./user-store";
import { inspect } from "util";
import type { BrowserOptions } from "@sentry/electron/renderer";
import type { ElectronMainOptions } from "@sentry/electron/main";
/**
* "Translate" 'browser' to 'main' as Lens developer more familiar with the term 'main'
@@ -23,10 +24,14 @@ function mapProcessName(processType: string) {
/**
* Initialize Sentry for the current process so to send errors for debugging.
*/
export function SentryInit() {
export function initializeSentryReporting(init: (opts: BrowserOptions | ElectronMainOptions) => void) {
const processName = mapProcessName(process.type);
Sentry.init({
if (!sentryDsn) {
return; // do nothing if not configured to avoid uncaught error in dev mode
}
init({
beforeSend: (event) => {
// default to false, in case instance of UserStore is not created (yet)
const allowErrorReporting = UserStore.getInstance(false)?.allowErrorReporting ?? false;