write_error_chain

Function write_error_chain 

Source
pub fn write_error_chain(
    err: &dyn Error,
    stream: impl Write,
    level: impl AsRef<str>,
    color: impl DynColor + Copy,
) -> Result
Expand description

Format an error or warning chain.

ยงExample

error: Failed to install app
  Caused By: Failed to install dependency
  Caused By: Error writing failed `/home/ferris/deps/foo`: Permission denied
warning: Failed to create registry entry for Python 3.12
  Caused By: Security policy forbids chaining registry entries
error: Failed to download Python 3.12
 Caused by: Failed to fetch https://example.com/upload/python3.13.tar.zst
            Server says: This endpoint only support POST requests.

            For downloads, please refer to https://example.com/download/python3.13.tar.zst
 Caused by: Caused By: HTTP Error 400