Skip to content

docs: describe every source of MonitoredPipe#exception - #201

Merged
jcouball merged 1 commit into
mainfrom
issue-193-exception-docs
Aug 31, 2026
Merged

jcouball merged 1 commit into
mainfrom
issue-193-exception-docs

Conversation

@jcouball

Copy link
Copy Markdown
Member

Implements #193 (docs-only scope).

The docs for MonitoredPipe#exception said it holds "the exception raised by a destination", but the attribute records any failure while collecting output: a destination #write raising, the monitor loop raising, or pipe cleanup raising. Commands::Run reports the recorded exception as the cause of a ProcessIOError, so the narrow wording reached users.

This PR broadens the attribute docs and the matching class-level paragraph, and writes down two behaviors that had no documentation: the first recorded exception wins, and in the double-failure corner (monitor loop raises, then cleanup also raises) the cleanup error is the one recorded. The #close docs were checked per the issue's acceptance criteria and need no change. No code or spec changes.

Validation

  • ruby 4.0.6: bundle exec rake passes (100% line coverage, no RuboCop or yardstick offenses, 100% YARD coverage)
  • jruby-10.0.6.0: bundle exec rake passes
  • truffleruby-24.2.1: bundle exec rake passes
  • MRI on Windows (run by @jcouball)
  • ruby-git rake suite against this branch (run by @jcouball)

Closes #193

The docs for #exception said it holds "the exception raised by a
destination", but the attribute records any failure while collecting
output: a destination #write raising, the monitor loop raising, or pipe
cleanup raising. A user inspecting the cause of a ProcessIOError was
told a narrower story than the truth.

Broaden the attribute docs and the matching class-level paragraph, and
state two behaviors that were previously unwritten: the first recorded
exception wins, and in the double-failure corner (monitor loop raises,
then cleanup also raises) the cleanup error is the one recorded because
the monitor-loop exception reaches its recording site last.

The #close docs were verified against the issue's criteria and need no
change; their wording is already source-neutral. No behavior change.
Copilot AI lite review requested due to automatic review settings August 31, 2026 22:37

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The changes are documentation-only, and the updated wording matches the verified exception-recording behavior in MonitoredPipe without introducing any code or test risk.

Pull request overview

This PR updates YARD documentation in ProcessExecuter::MonitoredPipe to accurately describe all sources and precedence behavior of MonitoredPipe#exception, aligning user-facing docs with the actual failure-recording behavior used by Commands::Run when setting ProcessIOError#cause.

Changes:

  • Broadens the class-level documentation to state that {#exception} may come from destination writes, the monitor loop, or pipe cleanup.
  • Expands the #exception attribute docs to document “first recorded wins” and the specific double-failure corner where cleanup can supersede a monitor-loop exception.
  • Updates the @return description to match the broader meaning (“first recorded exception”).
File summaries
File Description
lib/process_executer/monitored_pipe.rb Expands YARD docs for MonitoredPipe#exception and related class-level wording to reflect all recording sites and precedence behavior.
Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@jcouball
jcouball merged commit 333b7bd into main Aug 31, 2026
9 checks passed
@jcouball
jcouball deleted the issue-193-exception-docs branch August 31, 2026 22:44
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.

Correct MonitoredPipe exception docs to describe everything #exception records

2 participants