diff --git a/api/src/app.ts b/api/src/app.ts index bb892b80..c371d69a 100644 --- a/api/src/app.ts +++ b/api/src/app.ts @@ -28,6 +28,7 @@ export const createApp = (): { app: Express, router: express.Router } => { }), ], tracesSampleRate: 1.0, + ignoreErrors: [/Transmitter .+ not found/, /^Failed to fetch strands$/, /Drive with id .+ not found/], }); app.use(Sentry.Handlers.requestHandler()); diff --git a/api/src/logger.ts b/api/src/logger.ts index e58a1540..fddedda2 100644 --- a/api/src/logger.ts +++ b/api/src/logger.ts @@ -53,6 +53,7 @@ const transport = process.env.SENTRY_DSN ? { options: { sentry: { dsn: process.env.SENTRY_DSN, + ignoreErrors: [/Transmitter .+ not found/, /^Failed to fetch strands$/, /Drive with id .+ not found/], // additional options for sentry }, withLogRecord: true, // default false - send the log record to sentry as a context.(if its more then 8Kb Sentry will throw an error) diff --git a/api/src/modules/document-drive/drive-resolver.ts b/api/src/modules/document-drive/drive-resolver.ts index d75f5277..d2c49ac6 100644 --- a/api/src/modules/document-drive/drive-resolver.ts +++ b/api/src/modules/document-drive/drive-resolver.ts @@ -275,8 +275,12 @@ export const syncType = objectType({ })), })); } catch (e) { - logger.error(e); - throw new Error('Failed to fetch strands'); + if ((e as Error).message?.match(/Transmitter .+ not found/)) { + throw e; + } else { + logger.error(e); + throw new Error('Failed to fetch strands'); + } } }, });