pub fn classify_materialize_error(err: Error) -> HeddleErrorExpand description
Classify an anyhow error from a materialize/hydrate helper into the
HeddleError the start transaction’s Result requires.
Mirrors CLI start_atomic::apply_error (heddle#571): must NOT blanket-wrap
every failure as a Conflict. A plain I/O failure mid-materialize (e.g.
clonefile/FICLONE ENOENT) must surface as Io so diagnosis and
exit::from_error kind-keyed classification stay correct.
Recovery rules:
- an already-structured
HeddleErrorkeeps its variant; - an error whose chain bottoms out in a
std::io::ErrorbecomesHeddleError::Io, preserving both the originalErrorKindand the fullanyhowcontext ({err:#}) as the message; - only a genuinely-unclassifiable error falls back to
HeddleError::Conflict.