spl-forge 0.1.0

A CLI toolkit for creating and managing SPL assets on Solana
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use crate::common::theme;
pub struct ErrorLog;

impl ErrorLog {
    pub fn error_log(error: &anyhow::Error) {
        eprintln!("{} {}", theme::error("Error:"), error);

        if let Some(root_cause) = error.root_cause().to_string().lines().last() {
             if root_cause != error.to_string() {
                 eprintln!("{} {}", theme::muted("Root Cause:"), theme::muted(root_cause));
             }
        }
    }
}