[codex] Structure bootstrap errors#3256
Conversation
Co-authored-by: codex <codex@users.noreply.github.com>
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
ApprovabilityVerdict: Approved This PR refactors error handling by replacing a generic BootstrapError with four specific typed error classes, each capturing relevant context (fd, platform, cause). The change improves error observability without altering runtime behavior, and includes comprehensive test coverage for all new error types. You can customize Macroscope's approvability policy. Learn more. |
Summary
Validation
Note
Low Risk
Localized bootstrap I/O error typing and observability; success, timeout, unavailable-fd, and duplication-fallback behavior are unchanged and covered by tests.
Overview
Replaces the single generic
BootstrapErrorwith four schema-tagged failures (BootstrapFdStatError,BootstrapInputStreamOpenError,BootstrapEnvelopeReadError,BootstrapEnvelopeDecodeError) exposed as aBootstrapErrorunion, each carrying fd (and platform / fdPath for stream-open) plus the original cause.readBootstrapEnvelopenow fails with the specific tag at stat, stream open, read, and decode boundaries; unavailable fds still yieldOption.none()viacatchTagson stat/read when errno is EBADF/ENOENT, while non-availability stat errors (e.g. EACCES) propagate. Stream-open messages and context are updated (fd path resolved before the try block).Tests add fs mocks for configurable
openSyncfailures andfstatSyncEACCES, plus cases that assert error type, fields, messages, and preserved causes.Reviewed by Cursor Bugbot for commit 9333880. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Structure bootstrap errors into typed error classes in
readBootstrapEnvelopeBootstrapErrorwith four specific tagged error classes:BootstrapFdStatError,BootstrapInputStreamOpenError,BootstrapEnvelopeReadError, andBootstrapEnvelopeDecodeError.fdand the originalcause, withBootstrapInputStreamOpenErroralso includingplatformand optionalfdPath.isFdReadynow re-fails withBootstrapFdStatErrorwhenfstatSyncfails for reasons other than fd unavailability, instead of silently swallowing the error.Macroscope summarized 9333880.