Skip to content

fix(api): return JSON 500 when bucketed telemetry query fails - #137

Merged
MrAlders0n merged 1 commit into
devfrom
telemetry-bucketed-panic
Sep 10, 2026
Merged

MrAlders0n merged 1 commit into
devfrom
telemetry-bucketed-panic

Conversation

@MrAlders0n

Copy link
Copy Markdown
Member

Summary

getObserverTelemetry declared a fresh err with := inside the bucketed branch, so a failing GetObserverTelemetryBucketed never reached the outer error check. telemetry stayed nil and the handler panicked on telemetry.Range = ...; chi's recoverer turned that into a bare 500 with no {"error": ...} body. Only reachable with interval=6h or 24h, the 7d/30d charts in beacon-web.

Assigns with = instead, and adds a handler test that stubs a store error on the bucketed path and asserts a JSON internal_server_error response. The test panics without the fix.

Closes the telemetry-bucketed-error-panic ticket in beacon-docs.

The bucketed branch declared a new err with :=, so a store error never
reached the outer check and the handler dereferenced a nil telemetry.
@MrAlders0n
MrAlders0n requested a review from 446564 as a code owner September 10, 2026 11:21
@MrAlders0n
MrAlders0n merged commit e15f873 into dev Sep 10, 2026
3 checks passed
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