Render an error to stderr. `{:#}` joins the cause chain so the root reason isn't swallowed.
(e: &anyhow::Error)
| 97 | |
| 98 | /// Render an error to stderr. `{:#}` joins the cause chain so the root reason isn't swallowed. |
| 99 | pub fn error(e: &anyhow::Error) { |
| 100 | if plain() { |
| 101 | eprintln!("error: {e:#}"); |
| 102 | } else { |
| 103 | eprintln!("{} {e:#}", "error:".red()); |
| 104 | } |
| 105 | } |
| 106 | |
| 107 | // Braille frames used by the spinner; match the rest of the UI's unicode style. |
| 108 | const SPIN_FRAMES: &[&str] = &["⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"]; |