pub enum WechatError {
}Expand description
WeChat SDK error types
§Variants
Http: HTTP request/response errorsJson: JSON serialization/deserialization errorsApi: WeChat API returned an errorToken: Access token related errorsConfig: Configuration errorsSignature: Signature verification errorsCrypto: Cryptography operation errorsInvalidAppId: Invalid AppId formatInvalidOpenId: Invalid OpenId formatInvalidAccessToken: Invalid access tokenInvalidAppSecret: Invalid AppSecretInvalidSessionKey: Invalid SessionKeyInvalidUnionId: Invalid UnionId
Variants§
Http(HttpError)
HTTP request/response error (includes decode errors)
Json(Error)
JSON serialization/deserialization error
Api
WeChat API returned an error
§Fields
code: Error code returned by WeChat APImessage: Error message from WeChat API
Token(String)
Access token related error
Config(String)
Configuration error
Signature(String)
Signature verification failed
Crypto(String)
Cryptography operation error
InvalidAppId(String)
Invalid AppId format
AppId must start with ‘wx’ and be 18 characters long
InvalidOpenId(String)
Invalid OpenId format
OpenId must be 20-40 characters
InvalidAccessToken(String)
Invalid AccessToken
InvalidAppSecret(String)
Invalid AppSecret
InvalidSessionKey(String)
Invalid SessionKey
InvalidUnionId(String)
Invalid UnionId
Implementations§
Source§impl WechatError
impl WechatError
Sourcepub fn is_transient(&self) -> bool
pub fn is_transient(&self) -> bool
Returns true when this error is safe to retry.
Trait Implementations§
Source§impl Clone for WechatError
impl Clone for WechatError
Source§impl Debug for WechatError
impl Debug for WechatError
Source§impl Display for WechatError
impl Display for WechatError
Source§impl Error for WechatError
impl Error for WechatError
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 WechatError
impl From<Error> for WechatError
Auto Trait Implementations§
impl Freeze for WechatError
impl !RefUnwindSafe for WechatError
impl Send for WechatError
impl Sync for WechatError
impl Unpin for WechatError
impl UnsafeUnpin for WechatError
impl !UnwindSafe for WechatError
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.