From 194c8a8bec2da5620cfbb497d5963dcc4cae2d77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=8B=E3=81=8C=E3=81=BF?= Date: Sun, 6 Oct 2024 14:54:47 +0800 Subject: [PATCH] fix: ignore connection timeout --- lib/sentry.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/sentry.ts b/lib/sentry.ts index 1cca3e04f..eea1c0684 100644 --- a/lib/sentry.ts +++ b/lib/sentry.ts @@ -1,5 +1,5 @@ import * as Sentry from '@sentry/electron' -import { isString, includes, get, each, takeRight, split } from 'lodash' +import { isString, some, get, each, takeRight, split } from 'lodash' import path from 'path' interface InitOptions { @@ -33,9 +33,8 @@ export const init = ({ build, paths }: InitOptions) => { dsn: 'https://bc58c4a7f37a43e8aa89ba9097536c84@sentry.io/1250935', beforeSend(event) { if ( - includes( - get(event, 'exception.mechanism.data.message'), - 'React is running in production mode', + some(['React is running in production mode', ':17027'], (messageToIgnore) => + get(event, 'exception.mechanism.data.message')?.includes(messageToIgnore), ) ) { return null