fix: Load sentry for task runner server only if configured (no-changelog) (#11420)

This commit is contained in:
Tomi Turtiainen 2024-10-25 17:52:39 +03:00 committed by GitHub
parent 7699240073
commit d6aaeea2ab
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -125,11 +125,13 @@ export class TaskRunnerServer {
const { app } = this; const { app } = this;
// Augment errors sent to Sentry // Augment errors sent to Sentry
const { if (this.globalConfig.sentry.backendDsn) {
Handlers: { requestHandler, errorHandler }, const {
} = await import('@sentry/node'); Handlers: { requestHandler, errorHandler },
app.use(requestHandler()); } = await import('@sentry/node');
app.use(errorHandler()); app.use(requestHandler());
app.use(errorHandler());
}
} }
private setupCommonMiddlewares() { private setupCommonMiddlewares() {