Skip to content

Commit

Permalink
DOC: update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
sandhya-spend committed Oct 18, 2024
1 parent 2dfd5b1 commit d1b138b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -219,3 +219,7 @@ export let CommandButton = observer(({command, children}) => (
</button>
))
```
## Capturing submission errors
Custom errors can be captured from `form.submit()` by throwing `ValidationError("Submission failed", errors)`. The `errros` object is of the same shape as the errors given by `validate()` on the form, that is, the keys are the fields and the values are arrays of errors for the field.

0 comments on commit d1b138b

Please sign in to comment.