Skip to content

Report a throwing status getter in its own row instead of crashing --status [patch] - #64

Merged
matt-edmondson merged 1 commit into
mainfrom
claude/status-survives-throwing-getter
Nov 4, 2026
Merged

matt-edmondson merged 1 commit into
mainfrom
claude/status-survives-throwing-getter

Conversation

@matt-edmondson

Copy link
Copy Markdown
Contributor

Fixes #62

What changed

  • StatusReport.Read(Func<string>) (internal) evaluates a tool's getter and, on a non-fatal exception (FatalError.IsNotFatal, as elsewhere in the library), returns error: <message> instead of throwing.
  • StatusReport.Build reads every detail through it, and RunAsync reads the State getter through it, so one failing getter no longer aborts the process and loses the Platform / Tray icon rows.
  • Exit code stays 0 for --status; the failing row carries the error.

No public API change.

Tests

  • StatusReportTests.Build_WithAThrowingDetail_ReportsTheErrorInItsRowAndKeepsTheRest
  • StatusReportTests.Read_WithAThrowingGetter_ReturnsTheError
  • TrayAppBuilderTests.RunAsync_WithStatusAndThrowingGetters_PrintsEveryRowAndExitsZero (throwing State and detail getters through --no-tray --status)

With the catch removed, all three fail with the getter's exception; with it, the full suite passes (163 passed, 1 skipped). Release build is clean.


Generated by Claude Code

…status [patch]

StatusReport.Build read each detail's getter directly, and RunAsync invoked the
State getter at the call site, so one throwing getter aborted the process
(exit 134) and lost every row of the report. Both now go through
StatusReport.Read, which absorbs non-fatal exceptions the same way the rest of
the library does and prints "error: <message>" in that row.

Fixes #62

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017vfJW4brDwN4YAzA6oCKV6
@sonarqubecloud

sonarqubecloud Bot commented Nov 1, 2026

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

--status crashes with an unhandled exception (exit 134) when a status getter throws, losing the whole diagnostic report

2 participants