Skip to main content

maybe_fail_at

Function maybe_fail_at 

Source
pub fn maybe_fail_at(name: &str) -> Result<()>
Expand description

Like maybe_panic_at, but returns an io::Error instead of panicking — for exercising in-process error-recovery paths (a graceful failure that drives a rollback) rather than crash recovery.

Production callers thread this where a returned error must unwind a partially-applied operation; tests opt in by listing the checkpoint name in HEDDLE_FAULT_INJECT and assert the rollback left no partial state. With the env var unset the cached None short-circuits, exactly like maybe_panic_at.