Skip to content

Commit

Permalink
feat: silence transmitter not found errors
Browse files Browse the repository at this point in the history
  • Loading branch information
acaldas committed Apr 25, 2024
1 parent e4f222e commit 8c86d77
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions api/src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down
1 change: 1 addition & 0 deletions api/src/logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
8 changes: 6 additions & 2 deletions api/src/modules/document-drive/drive-resolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}
}
},
});
Expand Down

0 comments on commit 8c86d77

Please sign in to comment.