aboutsummaryrefslogtreecommitdiff
path: root/src/lib/common/Sentry.ts
diff options
context:
space:
mode:
authorIRONM00N <64110067+IRONM00N@users.noreply.github.com>2022-07-10 21:54:43 +0200
committerIRONM00N <64110067+IRONM00N@users.noreply.github.com>2022-07-10 21:54:43 +0200
commit627979e836edd0801f9201a98e239bf697a211be (patch)
tree0cf2d347d4eb6f02bfcc714307c4e211664c53b9 /src/lib/common/Sentry.ts
parent131b44f23be250aed2aeacdb51321b141d2ede4f (diff)
downloadtanzanite-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.ts6
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,