gon error:test

Send a synthetic error to the GON Registry telemetry endpoint to verify that error reporting is working end-to-end. Useful after installing GON on a new machine, after toggling telemetry, or when debugging why reports aren't arriving in the admin dashboard.

Usage

gon error:test

The command prints diagnostic context, posts a RuntimeException to gon.rozklad.dev/api/v1/errors/telemetry-report, and reports the real HTTP status back to you. It reflects the actual state of the telemetry pipeline — no "ok" on failure.

Successful run

gon error:test
 
Sending test error to gon.rozklad.dev...
source: gon-cli
source_version: 1.37.34
install_id: d594e7e8-e451-4f14-b8cc-8a2ada39a44b
authenticated: yes
 
HTTP 200 test error accepted
Check /admin/errors/issues/tail on gon.rozklad.dev

On success, open the admin dashboard to see the report:

https://gon.rozklad.dev/admin/errors/issues/tail

Diagnostic context

Before submitting, the command prints four fields so you can confirm what's being sent:

  • source — always gon-cli, identifies which client the report came from
  • source_version — the running gon CLI version
  • install_id — a stable UUID v4 generated on first run and stored in ~/.gon/config.json. Lets the admin group reports by machine.
  • authenticatedyes when a GitHub token is present in ~/.gon/config.json (from gon auth:login), which attributes the report to your GON user; no means the report is submitted anonymously

Failure scenarios

If the report can't be delivered, gon error:test prints the HTTP status, the server response body, and a targeted hint for known failure modes. Exit code is non-zero.

HTTP 401 — telemetry key missing on server

Telemetry report failed
HTTP status: 401
Reason: Server returned HTTP 401
Response body: {"error":"Invalid telemetry key"}
 
Hint: 401 usually means the server is missing ERRORS_TELEMETRY_KEY in .env.
Set it via: gon env:set ERRORS_TELEMETRY_KEY=... production

HTTP 404 — endpoint not deployed

The Errors module on the server doesn't yet expose /api/v1/errors/telemetry-report. Deploy the latest release with gon release.

Network error

No HTTP status is returned — check your connection and whether gon.rozklad.dev is reachable.

Opt-out

Telemetry can be disabled per-machine by setting telemetry: false in ~/.gon/config.json, or by exporting GON_TELEMETRY=0 in the current shell. With telemetry disabled, gon error:test refuses to run and exits with an error so the disabled state is explicit.

GON_TELEMETRY=0 gon error:test
 
Telemetry is disabled. Enable it via gon.json "telemetry": true
(or unset GON_TELEMETRY=0 if the env var is set).

How it relates to automatic error reporting

Beyond this explicit command, gon also reports uncaught exceptions from any command automatically via the same telemetry pipeline — as long as telemetry is enabled. Install scripts (install.sh, install.ps1) additionally trap bash/PowerShell errors and post them too, so failures during the very first install are visible server-side.

gon error:test is the easiest way to verify that the whole chain — from CLI through network to admin dashboard — works on a given machine.