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:
2026-06-06 00:36:14 +02:00
parent e76554342b
commit c6699a9592
5 changed files with 48 additions and 7 deletions

View File

@@ -116,8 +116,13 @@ export default function WurfFormPage() {
expectedGoHomeDate: nn(form.expectedGoHomeDate),
notes: nn(form.notes),
}
const saved = await mutation.run(body)
navigate(`/wuerfe/${saved.id}`)
try {
const saved = await mutation.run(body)
navigate(`/wuerfe/${saved.id}`)
} catch {
// Error surfaced via mutation.error; swallow to avoid an unhandled
// rejection escaping this async submit handler.
}
}
if (isEdit && existing.loading) return <p className="muted">{de.common.loading}</p>