Skip to main content

spl_forge/common/
error.rs

1use crate::common::theme;
2pub struct ErrorLog;
3
4impl ErrorLog {
5    pub fn error_log(error: &anyhow::Error) {
6        eprintln!("{} {}", theme::error("Error:"), error);
7
8        if let Some(root_cause) = error.root_cause().to_string().lines().last() {
9             if root_cause != error.to_string() {
10                 eprintln!("{} {}", theme::muted("Root Cause:"), theme::muted(root_cause));
11             }
12        }
13    }
14}