email/sendmail/error.rs
1use std::{any::Any, result};
2
3use thiserror::Error;
4
5use crate::{AnyBoxedError, AnyError};
6
7/// The global `Result` alias of the module.
8pub type Result<T> = result::Result<T, Error>;
9
10/// The global `Error` enum of the module.
11#[derive(Debug, Error)]
12pub enum Error {
13 #[error("cannot execute sendmail command")]
14 ExecuteCommandError(#[source] process::Error),
15}
16
17impl AnyError for Error {
18 fn as_any(&self) -> &dyn Any {
19 self
20 }
21}
22
23impl From<Error> for AnyBoxedError {
24 fn from(err: Error) -> Self {
25 Box::new(err)
26 }
27}