fix: better 404 message in logs (#599)

This commit is contained in:
Emrik Östling
2026-08-04 22:02:26 +02:00
committed by GitHub
parent 3602f12113
commit 5cf7703dd4
2 changed files with 6 additions and 1 deletions
+1
View File
@@ -20,6 +20,7 @@ export default defineConfig(
parser: eslintParserTypeScript,
parserOptions: {
project: "./tsconfig.eslint.json",
tsconfigRootDir: import.meta.dirname,
},
globals: {
...globals.node,
+5 -1
View File
@@ -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);
});