From d166c9a69a156e4cb13b9d4807d8c21a6c4176d2 Mon Sep 17 00:00:00 2001 From: Rory& Date: Tue, 23 Sep 2025 23:45:27 +0200 Subject: [PATCH] Log validation errors --- src/api/util/handlers/route.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/api/util/handlers/route.ts b/src/api/util/handlers/route.ts index d09bbe55..b13c929e 100644 --- a/src/api/util/handlers/route.ts +++ b/src/api/util/handlers/route.ts @@ -133,6 +133,11 @@ export function route(opts: RouteOptions) { message: x.message || "", }), ); + if (process.env.LOG_VALIDATION_ERRORS) + console.log( + `[VALIDATION ERROR] ${req.method} ${req.originalUrl} -`, + validate?.errors, + ); throw FieldErrors(fields); } }