feat: error handling (partial)
This commit is contained in:
@@ -9,16 +9,12 @@ use regex::Regex;
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Constructor)]
|
||||
pub struct Catchable {
|
||||
msg: Option<String>,
|
||||
msg: String,
|
||||
}
|
||||
|
||||
impl Display for Catchable {
|
||||
fn fmt(&self, f: &mut Formatter<'_>) -> FmtResult {
|
||||
if let Some(ref msg) = self.msg {
|
||||
write!(f, "<error: {msg}>")
|
||||
} else {
|
||||
write!(f, "<error>")
|
||||
}
|
||||
write!(f, "<error: {}>", self.msg)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user