pleroma groups!!!!!! try it ->
https://piggo.space/hob
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
343 B
17 lines
343 B
4 years ago
|
use std::error::Error;
|
||
|
|
||
|
pub trait LogError {
|
||
|
fn log_error<S : AsRef<str>>(self, msg: S);
|
||
|
}
|
||
|
|
||
|
impl<V, E : Error> LogError for Result<V, E> {
|
||
|
fn log_error<S : AsRef<str>>(self, msg: S) {
|
||
|
match self {
|
||
|
Ok(_) => {}
|
||
|
Err(e) => {
|
||
|
error!("{}: {}", msg.as_ref(), e);
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|