fix: use proper error handling instead
This commit is contained in:
+3
-8
@@ -8,6 +8,9 @@ import { v1routes } from "./v1";
|
||||
const log = createLogger("APP");
|
||||
|
||||
const app = new Elysia()
|
||||
.onError(({ error }) => {
|
||||
console.error(error);
|
||||
})
|
||||
.use(
|
||||
openapi({
|
||||
exclude: { paths: ["/", "/health"] },
|
||||
@@ -43,11 +46,3 @@ v1routes(app);
|
||||
export type App = typeof app;
|
||||
|
||||
log`Serving ${app.server?.hostname}:${app.server?.port}`;
|
||||
|
||||
process.on("unhandledRejection", (reason) => {
|
||||
console.error(reason);
|
||||
});
|
||||
|
||||
process.on("uncaughtException", (err) => {
|
||||
console.error(err);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user