diff options
author | Madeline <46743919+MaddyUnderStars@users.noreply.github.com> | 2023-01-10 13:19:05 +1100 |
---|---|---|
committer | Madeline <46743919+MaddyUnderStars@users.noreply.github.com> | 2023-01-10 13:20:37 +1100 |
commit | 2f065e6b3793f2c2d4ab196a341cf23efb721011 (patch) | |
tree | 8966b0ec65d611d7b3a129e16d3276b58344ba44 /src/api | |
parent | Add error handler for individual gateway sockets (diff) | |
download | server-2f065e6b3793f2c2d4ab196a341cf23efb721011.tar.xz |
Move sentry init to util. use sentry in each module, not just bundle
Diffstat (limited to 'src/api')
-rw-r--r-- | src/api/Server.ts | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/api/Server.ts b/src/api/Server.ts index fff94936..1a0ea6b2 100644 --- a/src/api/Server.ts +++ b/src/api/Server.ts @@ -1,7 +1,7 @@ import "missing-native-js-functions"; import { Server, ServerOptions } from "lambert-server"; import { Authentication, CORS } from "./middlewares/"; -import { Config, initDatabase, initEvent } from "@fosscord/util"; +import { Config, initDatabase, initEvent, Sentry } from "@fosscord/util"; import { ErrorHandler } from "./middlewares/ErrorHandler"; import { BodyParser } from "./middlewares/BodyParser"; import { Router, Request, Response, NextFunction } from "express"; @@ -38,6 +38,7 @@ export class FosscordServer extends Server { await Config.init(); await initEvent(); await initInstance(); + await Sentry.init(this.app); let logRequests = process.env["LOG_REQUESTS"] != undefined; if (logRequests) { @@ -96,6 +97,8 @@ export class FosscordServer extends Server { this.app.use(ErrorHandler); TestClient(this.app); + Sentry.errorHandler(this.app); + if (logRequests) console.log( red( |