You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
π Express error handler captures errors with an empty message and no request contextΒ #4241
What β server errors that reach the Express error handler with an empty message land in PostHog Error Tracking with nothing to read: no message, no stack, no route. Why β such a group cannot be triaged: nobody can tell which request failed or whether a user saw it.
Scope
Seen in a downstream consumer: one Error Tracking group with an empty message, no stack, level unset, source system β 5 events in 30 days, 2 in the last day, first seen 3 weeks ago.
Level unset + source system match the 4-arg middleware in lib/services/errorTracker.js (setupExpressErrorHandler): it calls captureException(err, { distinctId, requestId }) only β no method, route or status. The Winston transport (logger.posthog.transport.js) always sets logLevel, so it is not the source.
Fix: add method, the route path (no query string), and the status code to the captured properties; when err.message is empty, capture a message like <METHOD> <route> <status> so the group is named; skip expected 4xx (status < 500), as the logger does for expected outcomes.
Tests: an error with an empty message passed to next() is captured with method, route and status; a 4xx is not captured.
Rank β P2: no user sees it, but the error is invisible to triage.
Activity
PierreBrisorgueil commentedon Oct 30, 2026
WIP β session 20261030T212813Z-E4C1707B, branch fix/error-tracker-request-context, started 2026-10-30T21:28:13Z
PierreBrisorgueil commentedon Oct 30, 2026
merged via drain (no hold, --review: false) β PR #4242, squash 3e3299f