Skip to content

Expose Zod Validation Error Messages #51

@MPiccinato

Description

@MPiccinato

It looks like errors from Zod validation on the request body are not flowing through but at some point they were intended to.

(Looking at the history, the errorMessages array was joined in the return string)

https://github.com/Bekacru/better-call/blob/638acd821f03cdb7016b3e4784092eef42b4cbbc/src/validator.ts#L74

Right now to make any use of error messages that are returned from a Zod validation I have to omit the body option and handle the running the validation myself.

Any objection to having the issues flow up so they can be used in the routers onError callback?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions