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;
// Augment errors sent to Sentry
const {
Handlers: { requestHandler, errorHandler },
} = await import('@sentry/node');
app.use(requestHandler());
app.use(errorHandler());
if (this.globalConfig.sentry.backendDsn) {
const {
Handlers: { requestHandler, errorHandler },
} = await import('@sentry/node');
app.use(requestHandler());
app.use(errorHandler());
}
}
private setupCommonMiddlewares() {