Closed skorphil closed 4 months ago
To implement this, the throwing an errors should be precise (try catch on specific logic block). Also should avoid nesting try...catch, because rethrowing error seems not optimal.
try {
throw1
throw2
throw3
} catch () // will get 1,2 or 3
try {
try {
t1, t2, t3
} catch // will get 1,2 or 3 {
throw 4
}
} catch // will get 4
https://github.com/skorphil/nextjs-form/assets/6762009/714dc4ff-96d9-4ffb-af73-d83c6dcac3fc
If submitting the form fails, it must be error toast explaining what is happened