pub enum MailerError {
InvalidMessage(String),
Unauthorized(String),
Rejected(String),
Transport(String),
RateLimited(String),
Unknown(String),
}Expand description
Why a send failed, classified in a backend-neutral way.
The inner String carries backend-provided detail suitable for
logs and error pages. Do not parse it; use the variant for
branching.
Variants§
InvalidMessage(String)
The message is malformed before the backend even tries to send: missing recipient, empty body, forbidden header, attachment too large. The caller MUST NOT retry blindly — the message needs to change.
The caller is not authorised to send as from.email (SES
unverified sender, SMTP AUTH refused for that domain, etc).
Usually a config problem.
Rejected(String)
The backend explicitly rejected the message after accepting the request: policy reasons, spam filter, recipient on suppression list. Do not retry.
Transport(String)
Transient delivery problem at the transport layer (TCP reset, DNS failure, 5xx SMTP reply, 5xx API response). Safe to retry with backoff.
RateLimited(String)
The backend asked the caller to slow down (SMTP 421, SES throttling exception). Retry after a delay.
Unknown(String)
Anything the backend couldn’t classify. Treat like
Transport unless you have reason to believe otherwise.
Implementations§
Source§impl MailerError
impl MailerError
Trait Implementations§
Source§impl Clone for MailerError
impl Clone for MailerError
Source§fn clone(&self) -> MailerError
fn clone(&self) -> MailerError
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for MailerError
impl Debug for MailerError
Source§impl<'de> Deserialize<'de> for MailerError
impl<'de> Deserialize<'de> for MailerError
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Display for MailerError
impl Display for MailerError
Source§impl Error for MailerError
impl Error for MailerError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()