summary refs log tree commit diff
path: root/src/api/util
diff options
context:
space:
mode:
authorRory& <root@rory.gay>2025-09-23 23:45:27 +0200
committerRory& <root@rory.gay>2025-09-29 18:38:06 +0200
commitd166c9a69a156e4cb13b9d4807d8c21a6c4176d2 (patch)
tree10def18ac6dca839045b11709c5fb9f9bb98c833 /src/api/util
parentTry to handle new attachment style in message handler (diff)
downloadserver-ts-d166c9a69a156e4cb13b9d4807d8c21a6c4176d2.tar.xz
Log validation errors
Diffstat (limited to 'src/api/util')
-rw-r--r--src/api/util/handlers/route.ts5
1 files changed, 5 insertions, 0 deletions
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); } }