From 05d32f922264bbac05244911b32a99a42e12a96f Mon Sep 17 00:00:00 2001 From: Tom Winter Date: Thu, 29 Feb 2024 14:47:29 +0100 Subject: [PATCH] fix: use boolean to parse sentry config enabled flag --- src/config/app.yaml | 2 +- src/sentry.configuration.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/config/app.yaml b/src/config/app.yaml index 3072f5a..f381601 100644 --- a/src/config/app.yaml +++ b/src/config/app.yaml @@ -29,7 +29,7 @@ OPENID_CONFIGURATION: http://localhost:8080/realms/dummy-realm/.well-known/openi # values can be overwritten in .env file SENTRY: - ENABLED: false + ENABLED: true INSTANCE_NAME: local-development # can be personalised in .env -> local-development- ENVIRONMENT: local # local | development | production DSN: '' diff --git a/src/sentry.configuration.ts b/src/sentry.configuration.ts index fcbcc5b..3816dc5 100644 --- a/src/sentry.configuration.ts +++ b/src/sentry.configuration.ts @@ -4,7 +4,7 @@ import { ArgumentsHost, INestApplication } from '@nestjs/common'; import { BaseExceptionFilter, HttpAdapterHost } from '@nestjs/core'; export class SentryConfiguration { - ENABLED = ''; + ENABLED: boolean = false; DSN = ''; INSTANCE_NAME = ''; ENVIRONMENT = ''; @@ -26,7 +26,7 @@ export function configureSentry( configService: ConfigService, ): void { const sentryConfiguration = loadSentryConfiguration(configService); - if (sentryConfiguration.ENABLED === 'true') { + if (sentryConfiguration.ENABLED) { configureLoggingSentry(app, sentryConfiguration); } }