Skip to content

Commit 6b9b1d1

Browse files
authored
chore: Log request/response contents when a validation error occurs (RocketChat#37170)
1 parent 085d653 commit 6b9b1d1

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

packages/http-router/src/Router.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,8 @@ export class Router<
207207
method: req.method,
208208
path: req.url,
209209
error: validatorFn.errors?.map((error: any) => error.message).join('\n '),
210+
bodyParams: undefined,
211+
queryParams,
210212
});
211213
return c.json(
212214
{
@@ -229,6 +231,8 @@ export class Router<
229231
method: req.method,
230232
path: req.url,
231233
error: validatorFn.errors?.map((error: any) => error.message).join('\n '),
234+
bodyParams,
235+
queryParams: undefined,
232236
});
233237
return c.json(
234238
{
@@ -260,6 +264,7 @@ export class Router<
260264
method: req.method,
261265
path: req.url,
262266
error: responseValidatorFn.errors?.map((error: any) => error.message).join('\n '),
267+
originalResponse: body,
263268
});
264269
return c.json(
265270
{

0 commit comments

Comments
 (0)