atm0s_sdn_utils/
error_handle.rs

1use std::fmt::Debug;
2
3pub trait ErrorUtils {
4    fn print_error(&self, msg: &str);
5}
6
7impl<T, E> ErrorUtils for Result<T, E>
8where
9    E: Debug,
10{
11    fn print_error(&self, msg: &str) {
12        match self {
13            Ok(_) => {}
14            Err(e) => {
15                log::error!("Error: {} {:?}", msg, e);
16            }
17        }
18    }
19}