Skip to main content

collect_reloader_errors

Function collect_reloader_errors 

Source
pub fn collect_reloader_errors(errors: Vec<Error>) -> Result<()>
Expand description

Port of collectReloaderErrors: filters out cancellation errors (expected during graceful shutdown) and returns any real failures.

Deviation from Go: errors.Join supports unwrapping into multiple underlying errors via Unwrap() []error, which anyhow::Error has no equivalent for. When more than one real (non-cancellation) error remains, they’re joined into a single anyhow::Error whose message contains every original error’s Display output, but only the single error case preserves the original error’s type for downcast_ref (matching every test that exercises this: they only ever inject one real failure alongside cancellations).

§Errors

Returns an error if any input error is not a cancellation (xianyun_executor::exec::ExecError::Cancelled).