diff options
author | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2022-08-18 22:42:12 -0400 |
---|---|---|
committer | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2022-08-18 22:42:12 -0400 |
commit | 2356d2c44736fb83021dacb551625852111c8ce6 (patch) | |
tree | 10408d22fdd7a358d2f5c5917c3b59e55aa4c19d /lib/common/Sentry.ts | |
parent | 8aed6f93f7740c592cbc0e2f9fd3269c05286077 (diff) | |
download | tanzanite-2356d2c44736fb83021dacb551625852111c8ce6.tar.gz tanzanite-2356d2c44736fb83021dacb551625852111c8ce6.tar.bz2 tanzanite-2356d2c44736fb83021dacb551625852111c8ce6.zip |
restructure, experimental presence and member automod, fixed bugs probably made some more bugs
Diffstat (limited to 'lib/common/Sentry.ts')
-rw-r--r-- | lib/common/Sentry.ts | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/lib/common/Sentry.ts b/lib/common/Sentry.ts new file mode 100644 index 0000000..446ec27 --- /dev/null +++ b/lib/common/Sentry.ts @@ -0,0 +1,24 @@ +import { RewriteFrames } from '@sentry/integrations'; +import * as SentryNode from '@sentry/node'; +import { Integrations } from '@sentry/node'; +import type { Config } from '../../config/Config.js'; + +export class Sentry { + 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, + tracesSampleRate: 1.0, + integrations: [ + new RewriteFrames({ + root: rootdir + }), + new Integrations.OnUnhandledRejection({ + mode: 'none' + }) + ] + }); + } +} |