From d1b138b66bbeeae5bf9e523cb2b13d9a6af0a7bd Mon Sep 17 00:00:00 2001 From: Sandhya Govindaraju Date: Thu, 17 Oct 2024 19:18:36 -0500 Subject: [PATCH] DOC: update readme --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 714c182..a66adf5 100644 --- a/README.md +++ b/README.md @@ -219,3 +219,7 @@ export let CommandButton = observer(({command, children}) => ( )) ``` + +## 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. \ No newline at end of file