pub enum WechatIlinkError {
Api {
message: String,
http_status: u16,
errcode: i32,
},
RateLimited {
retry_after: Duration,
message: String,
http_status: u16,
errcode: i32,
},
Auth(String),
NoContext(String),
Media(String),
Transport(Error),
Json(Error),
Io(Error),
Other(String),
}Expand description
Errors that can occur in the SDK.
Variants§
Api
RateLimited
Auth(String)
NoContext(String)
Media(String)
Transport(Error)
Json(Error)
Io(Error)
Other(String)
Implementations§
Source§impl WechatIlinkError
impl WechatIlinkError
Sourcepub fn is_session_expired(&self) -> bool
pub fn is_session_expired(&self) -> bool
Returns true if this is a session-expired error (errcode -14).
Sourcepub fn is_rate_limited(&self) -> bool
pub fn is_rate_limited(&self) -> bool
Returns true if this is a bot-wide iLink rate limit response (ret/errcode -2).
Sourcepub fn retry_after(&self) -> Option<Duration>
pub fn retry_after(&self) -> Option<Duration>
Returns the suggested delay before retrying a rate-limited request.
Trait Implementations§
Source§impl Debug for WechatIlinkError
impl Debug for WechatIlinkError
Source§impl Display for WechatIlinkError
impl Display for WechatIlinkError
Source§impl Error for WechatIlinkError
impl Error for WechatIlinkError
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<Error> for WechatIlinkError
impl From<Error> for WechatIlinkError
Source§impl From<Error> for WechatIlinkError
impl From<Error> for WechatIlinkError
Auto Trait Implementations§
impl Freeze for WechatIlinkError
impl !RefUnwindSafe for WechatIlinkError
impl Send for WechatIlinkError
impl Sync for WechatIlinkError
impl Unpin for WechatIlinkError
impl UnsafeUnpin for WechatIlinkError
impl !UnwindSafe for WechatIlinkError
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