adds unhandled promise rejection listener just in case

This commit is contained in:
nai-degen 2023-05-13 13:37:42 -05:00
parent a7514e594d
commit 7126fb6c6c
1 changed files with 13 additions and 0 deletions

View File

@ -14,6 +14,19 @@ import { start as startRequestQueue } from "./proxy/queue";
const PORT = config.port; const PORT = config.port;
process.on("uncaughtException", (err: any) => {
logger.error(
{ err, stack: err?.stack },
"UNCAUGHT EXCEPTION. Please report this error trace."
);
});
process.on("unhandledRejection", (err: any) => {
logger.error(
{ err, stack: err?.stack },
"UNCAUGHT PROMISE REJECTION. Please report this error trace."
);
});
const app = express(); const app = express();
// middleware // middleware
app.use("/", rewriteTavernRequests); app.use("/", rewriteTavernRequests);