summary refs log tree commit diff
path: root/src/cdn/Server.ts
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/cdn/Server.ts
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/cdn/Server.ts')
-rw-r--r--src/cdn/Server.ts6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/cdn/Server.ts b/src/cdn/Server.ts
index 7340a735..abf59a2a 100644
--- a/src/cdn/Server.ts
+++ b/src/cdn/Server.ts
@@ -1,5 +1,5 @@
 import { Server, ServerOptions } from "lambert-server";
-import { Config, initDatabase, registerRoutes } from "@fosscord/util";
+import { Config, initDatabase, registerRoutes, Sentry } from "@fosscord/util";
 import path from "path";
 import avatarsRoute from "./routes/avatars";
 import guildProfilesRoute from "./routes/guild-profiles";
@@ -18,6 +18,8 @@ export class CDNServer extends Server {
 	async start() {
 		await initDatabase();
 		await Config.init();
+		await Sentry.init(this.app);
+
 		this.app.use((req, res, next) => {
 			res.set("Access-Control-Allow-Origin", "*");
 			// TODO: use better CSP policy
@@ -87,6 +89,8 @@ export class CDNServer extends Server {
 		);
 		this.log("verbose", "[Server] Route /guilds/banners registered");
 
+		Sentry.errorHandler(this.app);
+
 		return super.start();
 	}