Skip to content

update: Allow customizing validation error - #26

Merged
Bekacru merged 10 commits into
better-auth:mainfrom
ping-maxwell:update/endpoint/custom-validation-error
Dec 2, 2025
Merged

update: Allow customizing validation error#26
Bekacru merged 10 commits into
better-auth:mainfrom
ping-maxwell:update/endpoint/custom-validation-error

Conversation

@ping-maxwell

@ping-maxwell ping-maxwell commented Jul 21, 2025

Copy link
Copy Markdown
Collaborator

This PR adds a onValidationError in the endpoint options to allow devs to intercept the validation error and throw their own custom APIError message if desired.

Solves https://discord.com/channels/1288403910284935179/1396273521889509488

This PR adds a `onValidationError` in the endpoint options to allow devs to intercept the validation error and throw their own custom error message if desired.
@0xJJW

0xJJW commented Jul 21, 2025

Copy link
Copy Markdown

This looks awesome @ping-maxwell! Thank you for implementing it so quickly.

@Bekacru

Bekacru commented Aug 8, 2025

Copy link
Copy Markdown
Collaborator

can you add test to this? @ping-maxwell

@ping-maxwell

Copy link
Copy Markdown
Collaborator Author

@Bekacru Done.

Comment thread src/validator.ts Outdated
@ping-maxwell
ping-maxwell requested a review from Bekacru August 9, 2025 14:22
@pkg-pr-new

pkg-pr-new Bot commented Dec 2, 2025

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/Bekacru/better-call@26

commit: 58a6c44

@Bekacru
Bekacru merged commit e246646 into better-auth:main Dec 2, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants