From a9256a765f24ba38f67796b6d977705cde88be53 Mon Sep 17 00:00:00 2001 From: marcuspaico Date: Mon, 17 Aug 2026 16:17:03 -0700 Subject: [PATCH] fix(web): error handling on discard and history toggle - LabDraft.tsx discard button: chain .catch to surface a failed discard in the existing error banner instead of an unhandled rejection. - LabDraw.tsx toggleHistory: wrap the marker-history fetch in try/catch so a failed request silently no-ops (the row just doesn't expand) rather than throwing unhandled from the click handler. --- web/src/pages/LabDraft.tsx | 13 ++++++++++++- web/src/pages/LabDraw.tsx | 9 +++++++-- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/web/src/pages/LabDraft.tsx b/web/src/pages/LabDraft.tsx index adfcdaf..83a2940 100644 --- a/web/src/pages/LabDraft.tsx +++ b/web/src/pages/LabDraft.tsx @@ -80,7 +80,18 @@ export function LabDraft() { - + )} diff --git a/web/src/pages/LabDraw.tsx b/web/src/pages/LabDraw.tsx index a9acc90..4e62dc7 100644 --- a/web/src/pages/LabDraw.tsx +++ b/web/src/pages/LabDraw.tsx @@ -17,8 +17,13 @@ export function LabDraw() { setHistory((h) => { const { [key]: _, ...rest } = h; return rest; }); return; } - const h = await api.markerHistory(key); - setHistory((prev) => ({ ...prev, [key]: h })); + try { + const h = await api.markerHistory(key); + setHistory((prev) => ({ ...prev, [key]: h })); + } catch { + // Silently no-op: history is a supplemental, click-to-expand feature — + // a failed fetch should never throw unhandled or break the row. + } }; if (!detail) return

Loading…

;