Skip to content

Commit c36e561

Browse files
committed
feat(sdk): move transaction.finish to error and finish event + capture exception
1 parent b684274 commit c36e561

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

server/src/index.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,14 @@ export function validateGeneratedFile(req: Request, res: Response) {
6565
});
6666
stream.on('error', err => {
6767
res.status(500).send(err.message);
68+
Sentry.captureException(err);
69+
if (transaction) transaction.finish();
6870
});
6971
stream.on('finish', () => {
7072
res.status(200).send(encodeURIComponent(objectName));
73+
if (transaction) transaction.finish();
7174
});
7275

7376
stream.end(JSON.stringify(report));
74-
if (transaction) transaction.finish();
7577
});
7678
}

0 commit comments

Comments
 (0)