diff options
author | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2022-07-10 21:54:43 +0200 |
---|---|---|
committer | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2022-07-10 21:54:43 +0200 |
commit | 627979e836edd0801f9201a98e239bf697a211be (patch) | |
tree | 0cf2d347d4eb6f02bfcc714307c4e211664c53b9 /src/lib/common/Sentry.ts | |
parent | 131b44f23be250aed2aeacdb51321b141d2ede4f (diff) | |
download | tanzanite-627979e836edd0801f9201a98e239bf697a211be.tar.gz tanzanite-627979e836edd0801f9201a98e239bf697a211be.tar.bz2 tanzanite-627979e836edd0801f9201a98e239bf697a211be.zip |
allow more config options to be null / not set
Diffstat (limited to 'src/lib/common/Sentry.ts')
-rw-r--r-- | src/lib/common/Sentry.ts | 6 |
1 files changed, 4 insertions, 2 deletions
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, |