diff --git a/src/content/docs/useform/handlesubmit.mdx b/src/content/docs/useform/handlesubmit.mdx index 4246c0c81..f1586c63e 100644 --- a/src/content/docs/useform/handlesubmit.mdx +++ b/src/content/docs/useform/handlesubmit.mdx @@ -38,6 +38,10 @@ This function will receive the form data if form validation is successful. // await fetch() } catch (e) { // handle your error + setError("service", { + type: "custom", + message: "something went wrong", + }) } } diff --git a/src/data/api.tsx b/src/data/api.tsx index b2c6acf70..6327d62a2 100644 --- a/src/data/api.tsx +++ b/src/data/api.tsx @@ -968,6 +968,10 @@ handleSubmit(async (data) => await fetchAPI(data))`} // await fetch() } catch (e) { // handle your error + setError("service", { + type: "custom", + message: "something went wrong", + }) } };