pub fn failure_with_cause(
message: &str,
cause: Option<&dyn Display>,
) -> WorktreeCopyErrorExpand description
What: The diagnostic of one failed step: its message, then the cause when one exists. Why: A cause is appended exactly once, after the separator the incumbent uses.
In TS you’d write (pseudocode):
`${message}${cause === undefined ? '' : ` Cause: ${caughtValueText(cause)}`}`