summary refs log tree commit diff
path: root/src/api
diff options
context:
space:
mode:
authorMadeline <46743919+MaddyUnderStars@users.noreply.github.com>2023-01-10 13:19:05 +1100
committerMadeline <46743919+MaddyUnderStars@users.noreply.github.com>2023-01-10 13:20:37 +1100
commit2f065e6b3793f2c2d4ab196a341cf23efb721011 (patch)
tree8966b0ec65d611d7b3a129e16d3276b58344ba44 /src/api
parentAdd error handler for individual gateway sockets (diff)
downloadserver-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.ts5
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(