mirror of
https://github.com/spacebarchat/server.git
synced 2026-05-27 12:09:25 +00:00
Move sentry init to util. use sentry in each module, not just bundle
This commit is contained in:
+4
-1
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user