pub enum SlackError {
Http(Error),
EmptyMessage,
RateLimited {
retry_after_ms: u64,
},
ApiError {
status: u16,
message: String,
},
Json(Error),
InvalidUrl {
reason: String,
},
}Expand description
Errors that can occur when sending messages to Slack webhooks.
This error type is returned by all Slack client methods and wraps both transport-level errors and Slack API errors.
Variants§
Http(Error)
An underlying HTTP transport error from reqwest.
This includes network failures, connection timeouts, and TLS errors.
EmptyMessage
The message was empty.
Slack requires either text or blocks to be present.
RateLimited
Slack rate-limited the request.
The retry_after_ms field indicates how many milliseconds to wait
before retrying.
ApiError
Slack returned a non-success status code.
Contains the HTTP status code and the error message from Slack’s response.
Fields
Json(Error)
JSON serialization failed.
This typically occurs when the message structure is invalid or contains unsupported types.
InvalidUrl
The provided webhook URL is invalid.
URLs must use HTTPS and target hooks.slack.com/services/.
Trait Implementations§
Source§impl Debug for SlackError
impl Debug for SlackError
Source§impl Display for SlackError
impl Display for SlackError
Source§impl Error for SlackError
impl Error for SlackError
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()