Closed TornaxO7 closed 3 years ago
I've also tried this as shown in the quickstart.rs:
#[macro_use]
extern crate error_chain;
error_chain! {
errors {
ParseMail
ParseBody() {
description("Couldn't get the body of the parsed mail."),
display(""),
}
}
}
fn main() {
}
but I'm getting the same error message.
Ok, it was due to the empty brackets (()
). Removing them like this:
error_chain! {
errors {
ParseMail
// An error appeared, when it tried to parse the body of the mail!
ParseBody {
description("Couldn't get the body of the parsed mail."),
display(""),
}
/// An error appeared, when it tried to parse/get an attachment!
ParseAttachment
ParseFetch
ForgotHeader(missing_header: String) {
description(
concat![
"Couldn't parse the mail to a sendable mail ",
"because a header is missing."
]),
display("Missing header: '{}'", missing_header),
}
}
}
works.
Hello! I have this example code:
If I run
cargo check
then I'm getting the following error message:What am I doing wrong?