From 627979e836edd0801f9201a98e239bf697a211be Mon Sep 17 00:00:00 2001 From: IRONM00N <64110067+IRONM00N@users.noreply.github.com> Date: Sun, 10 Jul 2022 21:54:43 +0200 Subject: allow more config options to be null / not set --- src/lib/common/Sentry.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/lib/common') diff --git a/src/lib/common/Sentry.ts b/src/lib/common/Sentry.ts index 34bc06f..2792203 100644 --- a/src/lib/common/Sentry.ts +++ b/src/lib/common/Sentry.ts @@ -1,10 +1,12 @@ import { RewriteFrames } from '@sentry/integrations'; import * as SentryNode from '@sentry/node'; import { Integrations } from '@sentry/node'; -import config from '../../../config/options.js'; +import type { Config } from '../../../config/Config.js'; export class Sentry { - public constructor(rootdir: string) { + public constructor(rootdir: string, config: Config) { + if (config.credentials.sentryDsn === null) throw TypeError('sentryDsn cannot be null'); + SentryNode.init({ dsn: config.credentials.sentryDsn, environment: config.environment, -- cgit