mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Bump all @sentry related packages (#5155)
This commit is contained in:
1 parent
8e8ad6663b
commit
7fffa3643c
5 files changed
+105
-149
No files matched your search
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user