#[non_exhaustive]pub enum SlackError {
Config(String),
Api {
method: String,
code: String,
needed: Option<String>,
},
RateLimited {
retry_after_secs: Option<u64>,
},
Http {
status: u16,
body: String,
},
Transport(String),
Decode(String),
BadResponseUrl,
Verify(VerifyError),
}Expand description
Plugin and client errors. Messages never hold a token or a secret.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Config(String)
Bad config or bad input from the app.
Api
Slack replied ok: false.
Fields
RateLimited
Slack replied 429 and the client stopped.
Http
Slack replied with an HTTP error status.
Transport(String)
No HTTP reply: connect error or timeout.
Decode(String)
The reply is not the expected JSON.
BadResponseUrl
The response_url is not an allowed Slack URL.
Verify(VerifyError)
Request verification failed.
Implementations§
Source§impl SlackError
impl SlackError
Sourcepub fn slack_code(&self) -> Option<&str>
pub fn slack_code(&self) -> Option<&str>
Returns the Slack error code for an SlackError::Api error.
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)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl From<VerifyError> for SlackError
impl From<VerifyError> for SlackError
Source§fn from(source: VerifyError) -> Self
fn from(source: VerifyError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Forget for SlackError
impl Freeze for SlackError
impl RefUnwindSafe for SlackError
impl Send for SlackError
impl Sync for SlackError
impl Unpin for SlackError
impl UnsafeUnpin for SlackError
impl UnwindSafe for SlackError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T> Scoped for T
impl<T> Scoped for T
Source§fn scope(ctx: &PolicyContext) -> ScopeQuery<'_, Self>
fn scope(ctx: &PolicyContext) -> ScopeQuery<'_, Self>
Open a deferred
ScopeQuery for this type. Resolves the
registered scope at .load() time, not here.Source§impl<T> ValidateIp for Twhere
T: ToString,
impl<T> ValidateIp for Twhere
T: ToString,
Source§fn validate_ipv4(&self) -> bool
fn validate_ipv4(&self) -> bool
Validates whether the given string is an IP V4
Source§fn validate_ipv6(&self) -> bool
fn validate_ipv6(&self) -> bool
Validates whether the given string is an IP V6
Source§fn validate_ip(&self) -> bool
fn validate_ip(&self) -> bool
Validates whether the given string is an IP