-
Hi. I'm new to svelte and sveltekit and I'm trying to create a registration form. When I'm returning a normal response, everything works fine. However, when I'm throwing a 400 error, the page changes and
|
Beta Was this translation helpful? Give feedback.
Answered by
geoffrich
Mar 30, 2023
Replies: 1 comment 1 reply
-
You want to use |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
Paultje52
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You want to use
return fail
instead ofthrow error
-error
is treated as an unexpected error, whilefail
is used for validation errors. More info in the docs: https://kit.svelte.dev/docs/form-actions#anatomy-of-an-action-validation-errors