FEAT-3: fix unhandled ApiError rejections (catch in form submits + dev unhandledrejection guard, ApiError carries path)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -166,8 +166,13 @@ export default function GerbilFormPage() {
|
||||
genotype: nn(form.genotype),
|
||||
notes: nn(form.notes),
|
||||
}
|
||||
const saved = await mutation.run(body)
|
||||
navigate(`/rennmaeuse/${saved.id}`)
|
||||
try {
|
||||
const saved = await mutation.run(body)
|
||||
navigate(`/rennmaeuse/${saved.id}`)
|
||||
} catch {
|
||||
// Error is surfaced via mutation.error; swallow so the rejected promise
|
||||
// from this async submit handler doesn't become an unhandled rejection.
|
||||
}
|
||||
}
|
||||
|
||||
if (isEdit && existing.loading) return <p className="muted">{de.common.loading}</p>
|
||||
|
||||
Reference in New Issue
Block a user