From 5cf7703dd4d85348318ab3c364888816aa4ef8eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emrik=20=C3=96stling?= Date: Tue, 4 Aug 2026 22:02:26 +0200 Subject: [PATCH] fix: better 404 message in logs (#599) --- eslint.config.ts | 1 + src/index.tsx | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/eslint.config.ts b/eslint.config.ts index a94440a..8b493b3 100644 --- a/eslint.config.ts +++ b/eslint.config.ts @@ -20,6 +20,7 @@ export default defineConfig( parser: eslintParserTypeScript, parserOptions: { project: "./tsconfig.eslint.json", + tsconfigRootDir: import.meta.dirname, }, globals: { ...globals.node, diff --git a/src/index.tsx b/src/index.tsx index b48f31a..05713a8 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -50,7 +50,11 @@ const app = new Elysia({ .use(listConverters) .use(chooseConverter) .use(healthcheck) - .onError(({ error }) => { + .onError(({ error, code, request }) => { + if (code === "NOT_FOUND") { + console.warn(`404: ${request.method} ${new URL(request.url).pathname}`); + return; + } console.error(error); });