Skip to content

feat: WithVerboseErrors to surface real panic messages in dev#115

Merged
joaomdsg merged 1 commit into
mainfrom
fix/verbose-errors
Jun 10, 2026
Merged

feat: WithVerboseErrors to surface real panic messages in dev#115
joaomdsg merged 1 commit into
mainfrom
fix/verbose-errors

Conversation

@joaomdsg

Copy link
Copy Markdown
Member

Critic panel finding #6 (major; raised 3×) — scope corrected after reading the code.

The fix the critic described ("type-assert the recovered panic value") is already present: action.go:227-230 preserves panic(err) as a typed error for a custom WithActionErrorHandler, and the real message is logged server-side (:224). The only remaining gap is the default client surface, which masks panics as generic "Something went wrong" — correct for prod (no info disclosure), needlessly opaque in dev.

Change

WithVerboseErrors(): opt the default client notification into showing the real panic error message. Off by default.

Tests

  • default: raw panic message (boom-detail-42) does NOT reach the client; "Something went wrong" does
  • WithVerboseErrors: the real message reaches the client over SSE

Full ci-check.sh green.

@joaomdsg
joaomdsg force-pushed the fix/verbose-errors branch from c78947e to 0f5e7d7 Compare June 10, 2026 19:02
A recovered action panic shows the browser a generic "Something went wrong".
The typed error already reaches a custom WithActionErrorHandler and the server
log, but the default client surface masks the real message — fine for prod
(no info disclosure), needlessly opaque in development.

WithVerboseErrors() opts the default client notification into showing the real
error message. Off by default.
@joaomdsg
joaomdsg merged commit 3d78aaa into main Jun 10, 2026
4 checks passed
@joaomdsg
joaomdsg deleted the fix/verbose-errors branch June 10, 2026 19:06
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