Skip to content

Fix: surface the real booking error instead of generic 'Boeken mislukt'#6

Merged
guuse merged 1 commit into
mainfrom
fix/surface-booking-error
Jun 2, 2026
Merged

Fix: surface the real booking error instead of generic 'Boeken mislukt'#6
guuse merged 1 commit into
mainfrom
fix/surface-booking-error

Conversation

@guuse

@guuse guuse commented Jun 2, 2026

Copy link
Copy Markdown
Owner

Why

Booking from the leftover sidebar (and the timeline) showed a generic "Boeken mislukt" with no detail. The HTTP layer goes through Tauri invoke, which rejects with the Rust error string (the Simplicate API status + body) — not an Error instance. The catch checked err instanceof Error, so that real message was discarded and replaced by the generic fallback.

Fix

Surface string errors as-is (and console.error them); keep the generic message only for non-string, non-Error throws. Now a failed booking shows the actual Simplicate reason (e.g. Simplicate API error: 400 — ...), so the cause is visible instead of hidden.

This is a diagnostic + UX fix — it doesn't change why a given booking fails, but it makes the reason visible so it can be acted on.

39 useBooking tests pass, typecheck clean.

🤖 Generated with Claude Code

Tauri's invoke rejects with the Rust error STRING (e.g. the Simplicate API
status + body), which isn't an Error instance — so the catch fell back to a
generic "Boeken mislukt" and hid the actual reason a booking failed. Now string
errors are shown as-is (and logged), with the generic message kept only for
non-string, non-Error throws.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@github-actions

github-actions Bot commented Jun 2, 2026

Copy link
Copy Markdown

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 99.14% (🎯 95%) 2670 / 2693
🔵 Statements 98.54% (🎯 95%) 3051 / 3096
🔵 Functions 98.24% (🎯 95%) 784 / 798
🔵 Branches 95.97% (🎯 95%) 1717 / 1789
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
src/ui/hooks/useBooking.ts 100% 100% 100% 100%
Generated in workflow #18 for commit a52b9e3 by the Vitest Coverage Report Action

@guuse guuse merged commit e99eaa3 into main Jun 2, 2026
1 check passed
@guuse guuse deleted the fix/surface-booking-error branch June 2, 2026 12:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant