Add error catcher to Alu's server

This commit is contained in:
wearrrrr 2024-10-04 11:43:28 -05:00
parent 859d84969f
commit 7526623ce0
2 changed files with 7 additions and 0 deletions

View file

@ -13,6 +13,7 @@ import wisp from "wisp-server-node";
import router from "./middleware/ProxyExt/index.js"; import router from "./middleware/ProxyExt/index.js";
import { handler as astroSSR } from "./dist/server/entry.mjs"; import { handler as astroSSR } from "./dist/server/entry.mjs";
import cookies from "cookie-parser"; import cookies from "cookie-parser";
import "./middleware/catchErrors.js";
dotenv.config(); dotenv.config();

View file

@ -0,0 +1,6 @@
import chalk from "chalk";
process.on("uncaughtException", (err) => {
console.log(chalk.red("[Alu] Uncaught exception!", err));
process.exit(1);
});