mirror of
https://github.com/chatmail/core.git
synced 2026-04-28 02:46:29 +03:00
refactor: replace failure
- failure is deprecated - thiserror for deriving Error impl - anyhow for highlevel error handling
This commit is contained in:
committed by
GitHub
parent
d31265895d
commit
24f4cbbb27
@@ -8,15 +8,15 @@ use crate::events::Event;
|
||||
|
||||
pub type Result<T> = std::result::Result<T, Error>;
|
||||
|
||||
#[derive(Debug, Fail)]
|
||||
#[derive(Debug, thiserror::Error)]
|
||||
pub enum Error {
|
||||
#[fail(display = "Envelope error: {}", _0)]
|
||||
EnvelopeError(#[cause] async_smtp::error::Error),
|
||||
#[error("Envelope error: {}", _0)]
|
||||
EnvelopeError(#[from] async_smtp::error::Error),
|
||||
|
||||
#[fail(display = "Send error: {}", _0)]
|
||||
SendError(#[cause] async_smtp::smtp::error::Error),
|
||||
#[error("Send error: {}", _0)]
|
||||
SendError(#[from] async_smtp::smtp::error::Error),
|
||||
|
||||
#[fail(display = "SMTP has no transport")]
|
||||
#[error("SMTP has no transport")]
|
||||
NoTransport,
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user