mirror of
https://github.com/versia-pub/server.git
synced 2026-03-13 13:59:16 +01:00
feat(api): 🧑💻 Improve error quality with Youch
This commit is contained in:
parent
58b4d7454f
commit
1993231663
4 changed files with 37 additions and 5 deletions
|
|
@ -1,6 +1,7 @@
|
|||
import cluster from "node:cluster";
|
||||
import { sentry } from "@/sentry";
|
||||
import { createServer } from "@/server";
|
||||
import { Youch } from "youch";
|
||||
import { appFactory } from "~/app";
|
||||
import { config } from "~/config.ts";
|
||||
|
||||
|
|
@ -8,6 +9,12 @@ process.on("SIGINT", () => {
|
|||
process.exit();
|
||||
});
|
||||
|
||||
process.on("uncaughtException", async (error) => {
|
||||
const youch = new Youch();
|
||||
|
||||
console.error(await youch.toANSI(error));
|
||||
});
|
||||
|
||||
if (cluster.isPrimary) {
|
||||
for (let i = 0; i < Number(process.env.NUM_CPUS ?? 1); i++) {
|
||||
cluster.fork();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue