Skip to content

Custom error status for readValidatedBody, readValidatedQuery, etc #982

Open
@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?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    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