slack_hook3/error.rs
1pub use thiserror::Error;
2
3/// Public error type
4#[derive(Error, Debug)]
5pub enum SlackError {
6 /// Errors from hex library or internal hex errors
7 #[error("hex color parsing error: {0}")]
8 HexColor(String),
9
10 /// Errors from reqwest send/gets or reqwests url TryInto
11 #[error("slack service error: {0}")]
12 Http(String),
13
14 /// Errors from url's parser
15 #[error(transparent)]
16 Url(#[from] url::ParseError)
17}
18
19/// Error handling convenience type
20pub type Result<T> = std::result::Result<T, SlackError>;