Repository navigation
feat(telemetry): report uncaught errors - #5
Merged
Merged
Conversation
An error that breaks checkout was visible only in the console of the person it happened to, which means nobody who could fix it ever saw it. Adds a global ErrorHandler reporting uncaught errors to the API, off by default like the analytics port. The failure mode being reported on is a component throwing inside a render loop, which calls the handler as fast as the browser can loop. So an identical error is reported at most three times per session, there is a hard per-session ceiling, reports are batched, and a failing endpoint is swallowed. A reporter that turns a render loop into a request loop takes a broken page and makes it a broken page plus a hammered API. Anything can be thrown in JavaScript and frameworks do, so nothing assumes an Error shape: strings, bare objects and null all produce a usable report rather than an exception inside the error handler. The handler still logs to the console. Swallowing that would remove what a developer looks at first in exchange for a report they cannot see locally. A reporter that throws is caught, so it can never mask the original error. Closes #4 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YY1ekLLeFLkAU2kvdQ8Ey4
PhilippTheServer
force-pushed
the
pl/error-reporting
branch
from
August 26, 2026 16:36
67f4ce7 to
3602b99
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #4 · consumes OpenTaberna/fastapi#51
An error that breaks checkout was visible only in the console of the person it happened to.
A global
ErrorHandlernow reports uncaught errors to the API — off by default, like theanalytics port.
A render loop must not become a request loop
The failure mode being reported on is a component throwing during render, which calls the
handler as fast as the browser can loop. So:
A reporter that turns a render loop into a request loop takes a broken page and makes it a
broken page plus a hammered API.
Anything can be thrown in JavaScript
And frameworks do. Nothing assumes an
Errorshape — strings, bare objects andnullallproduce a usable report rather than an exception raised inside the error handler, which
would be a genuinely bad place to throw.
It still logs to the console
Swallowing that would remove what a developer looks at first, in exchange for a report they
cannot see locally. And if the reporter itself throws, that is caught, so it can never mask
the original error.
Verification
Twelve new tests, each pinning a way this could make things worse: 500 identical throws
produce 3 reports; 100 distinct errors stop at the ceiling; a thrown string, a bare object
and
nullare all handled; the query string is stripped from the reported path; a failingendpoint does not throw; the console still receives the error; and a reporter that throws
does not mask it.