Skip to main content

failure_with_cause

Function failure_with_cause 

Source
pub fn failure_with_cause(
    message: &str,
    cause: Option<&dyn Display>,
) -> WorktreeCopyError
Expand 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)}`}`