Skip to main content

rok_mail/
errors.rs

1use rok_core::rok_exception;
2
3rok_exception! {
4    /// Transport-level failure (SMTP unreachable, credentials rejected, …).
5    pub struct E_MAIL_TRANSPORT_ERROR {
6        status = 500,
7        self_handled = true,
8        fields: { pub source: String }
9    }
10}
11
12rok_exception! {
13    /// The mailer accepted the message but sending ultimately failed.
14    pub struct E_SEND_FAILED {
15        status = 500,
16        self_handled = true,
17        fields: { pub recipient: String }
18    }
19}
20
21rok_exception! {
22    /// Mail configuration is incomplete or invalid.
23    pub struct E_INVALID_MAILER_CONFIG {
24        status = 500,
25        self_handled = false,
26        fields: { pub detail: String }
27    }
28}
29
30rok_exception! {
31    /// Raised when `Mail::send()` is called outside a request context without an explicit config.
32    pub struct E_MAIL_NOT_CONFIGURED {
33        status = 500,
34        self_handled = false,
35        fields: {
36        }
37    }
38}