Log validation errors

This commit is contained in:
Rory& 2025-09-23 23:45:27 +02:00
parent 3bba7882fa
commit d166c9a69a

View File

@ -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);
}
}