:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
rules:
- id: toolbar-transport-no-error-tracking
message: |
Exception capture in the toolbar's transport layer. `toolbarFetch` and
`toolbarApi` must never report failures to error tracking: every failure they
see is request-shaped (4xx, 5xx, network, malformed body) and expected on
customer pages. They log via `toolbarLogger`, emit `toolbar api request`
telemetry, and return a failure result (`ToolbarApiResult` / a synthetic
`Response`) for the caller to handle. If a call site needs to raise, it throws
`ToolbarRequestError`, which the global kea loader handler logs without
capturing. Error tracking is reserved for genuine toolbar bugs, reported from
the code that owns them.
severity: ERROR
languages: [typescript]
paths:
include:
- frontend/src/toolbar/shared/toolbarApi.ts
- frontend/src/toolbar/shared/toolbarFetch.ts
pattern-either:
- pattern: captureToolbarException(...)
- pattern: $X.captureException(...)
metadata:
category: best-practice