Skip to content

Custom error status for readValidatedBody, readValidatedQuery, etc #982

@cosbgn

Description

@cosbgn

Describe the feature

I love readValidatedBody but 400 as status error is too generic, I use it for all sort of errors and I would like to have the ability to set a better error code.

Ideally it would simply be: readValidatedBody(event, schema.parse, 422)

it can be 400 as default so it wouldn't be a breaking change, even tough I would personally prefer 422

Additional information

  • Would you be willing to help implement this feature?

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions