{"record":{"id":"544ada9f6f0450b6","repo":"tinyhumansai/openhuman","slug":"openhuman-sentry-test-intentional-panic","errorCode":null,"errorMessage":"openhuman sentry-test intentional panic","messagePattern":"openhuman sentry-test intentional panic","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"info","filePath":"src/core/cli.rs","lineNumber":311,"sourceCode":"    });\n\n    let event_id = sentry::capture_message(&msg, sentry::Level::Error);\n\n    if let Some(c) = client {\n        if !c.flush(Some(std::time::Duration::from_secs(5))) {\n            eprintln!(\n                \"[sentry-test] WARNING: flush timed out after 5s — event may not have reached Sentry.\"\n            );\n        }\n    }\n\n    println!(\"{event_id}\");\n\n    if do_panic {\n        eprintln!(\n            \"[sentry-test] Triggering panic as requested — the panic integration should capture it.\"\n        );\n        panic!(\"openhuman sentry-test intentional panic\");\n    }\n\n    Ok(())\n}\n\n/// Disabled-build stand-in for [`run_sentry_test_command`]. Same signature as\n/// the `crash-reporting` version; reports that the probe is unavailable in a\n/// build compiled without the feature rather than pretending to succeed.\n#[cfg(not(feature = \"crash-reporting\"))]\nfn run_sentry_test_command(_args: &[String]) -> Result<()> {\n    Err(anyhow::anyhow!(\n        \"sentry-test unavailable: built without the crash-reporting feature — \\\n         rebuild with `--features crash-reporting`\"\n    ))\n}\n\n/// Loads key/value pairs from a `.env` file into the process environment.\n///","sourceCodeStart":293,"sourceCodeEnd":329,"githubUrl":"https://github.com/tinyhumansai/openhuman/blob/749120085864ce16e0f273c7b86fac7740b39c5b/src/core/cli.rs#L293-L329","documentation":"This is not a product fault: `openhuman sentry-test --panic` deliberately panics with this exact message to verify the crash-reporting integration captures native panics. The command first prints the captured event_id on stdout, flushes Sentry (warning after a 5s timeout), and only then panics - so a non-zero exit and a panic backtrace afterwards are expected observable results. In a build compiled without the crash-reporting feature the subcommand instead reports unavailability.","triggerScenarios":"Explicitly running `openhuman sentry-test --panic` to QA the Sentry DSN and symbol pipeline; CI smoke jobs that exercise the crash path end to end; a script accidentally leaving --panic in place when only event delivery was meant to be tested.","commonSituations":"Verifying Sentry configuration after uploading release symbols (scripts/upload_sentry_symbols.sh); testing the panic hook; the resulting Sentry event later being mistaken for a real crash during triage.","solutions":["If intentional, nothing to fix - match the event_id printed on stdout against the event in the Sentry dashboard to confirm delivery.","If the '[sentry-test] WARNING: flush timed out' line appears, investigate network egress or the DSN so events are not silently lost.","If you only wanted event delivery without the crash, re-run without the --panic flag."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"if (args.includes('--panic')) { // intentional crash: run in a disposable subprocess\n  expectNonZeroExit = true; }","typeGuard":null,"tryCatchPattern":"When scripting `openhuman sentry-test --panic`, spawn it as a subprocess and expect a non-zero exit plus the 'sentry-test intentional panic' message; treat that pair as success, capture the event_id from stdout, and match it in Sentry. Never let it run inside a long-lived process.","preventionTips":["Only pass --panic in disposable processes (CI step, one-shot shell).","Tag or filter these known events in Sentry so triage does not mistake them for product crashes.","Watch for the flush-timeout warning - it means delivery is at risk even though the panic fired."],"tags":["sentry","diagnostics","panic","crash-reporting","cli"],"backgroundTag":"intentional-test-panic","analyzedSha":"749120085864ce16e0f273c7b86fac7740b39c5b","analyzedAt":"2026-08-17T21:21:45.363Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}