Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions server/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ if (!config.SENTRY_DSN) {
throw new Error('SENTRY_DSN was not set in config.json');
}

Sentry.init({ dsn: config.SENTRY_DSN });
Sentry.init({ dsn: config.SENTRY_DSN, tracesSampleRate: 1 });

const storage = new Storage({
projectId: config.PROJECT
Expand Down Expand Up @@ -63,14 +63,16 @@ export function validateGeneratedFile(req: Request, res: Response) {
contentType: 'text/plain; charset=utf-8'
}
});
stream.on('error', err => {
stream.on('error', async err => {
res.status(500).send(err.message);
Sentry.captureException(err);
if (transaction) transaction.finish();
await Sentry.flush(5000);
});
stream.on('finish', () => {
stream.on('finish', async () => {
res.status(200).send(encodeURIComponent(objectName));
if (transaction) transaction.finish();
await Sentry.flush(5000);
});

stream.end(JSON.stringify(report));
Expand Down