pub enum LarkErrorCode {
Show 43 variants
Success = 0,
AppTicketInvalid = 10_012,
AccessTokenInvalid = 99_991_671,
AppAccessTokenInvalid = 99_991_664,
TenantAccessTokenInvalid = 99_991_663,
BadRequest = 400,
Unauthorized = 401,
Forbidden = 403,
NotFound = 404,
MethodNotAllowed = 405,
Conflict = 409,
TooManyRequests = 429,
InternalServerError = 500,
BadGateway = 502,
ServiceUnavailable = 503,
GatewayTimeout = 504,
AppNotInstalled = 10_003,
AppStatusException = 10_013,
AppPermissionDenied = 19_001,
UserNotFound = 60_001,
UserStatusException = 60_002,
DepartmentNotFound = 60_003,
ChatNotFound = 70_001,
ChatTypeNotSupported = 70_002,
MessageNotFound = 80_001,
MessageTypeNotSupported = 80_002,
FileNotFound = 90_001,
FileSizeExceeded = 90_002,
FileTypeNotSupported = 90_003,
CalendarNotFound = 110_001,
EventNotFound = 110_002,
EventConflict = 110_003,
DocumentNotFound = 120_001,
DocumentPermissionDenied = 120_002,
DocumentLocked = 120_003,
SheetNotFound = 120_011,
TableNotFound = 120_021,
AppNotPublished = 130_001,
AppVersionIncompatible = 130_002,
NetworkTimeout = 999_001,
NetworkConnectionFailed = 999_002,
DnsResolutionFailed = 999_003,
SslCertificateError = 999_004,
}Expand description
飞书API错误码的语义化枚举
Variants§
Success = 0
成功
AppTicketInvalid = 10_012
应用票据无效
AccessTokenInvalid = 99_991_671
访问令牌无效
AppAccessTokenInvalid = 99_991_664
应用访问令牌无效
TenantAccessTokenInvalid = 99_991_663
租户访问令牌无效
BadRequest = 400
请求参数错误
认证失败
Forbidden = 403
权限不足
NotFound = 404
资源不存在
MethodNotAllowed = 405
方法不允许
Conflict = 409
请求冲突
TooManyRequests = 429
请求频率过高
InternalServerError = 500
内部服务器错误
BadGateway = 502
网关错误
服务不可用
GatewayTimeout = 504
网关超时
AppNotInstalled = 10_003
应用未安装
AppStatusException = 10_013
应用状态异常
AppPermissionDenied = 19_001
应用权限不足
UserNotFound = 60_001
用户不存在
UserStatusException = 60_002
用户状态异常
DepartmentNotFound = 60_003
部门不存在
ChatNotFound = 70_001
群组不存在
ChatTypeNotSupported = 70_002
群组类型不支持
MessageNotFound = 80_001
消息不存在
MessageTypeNotSupported = 80_002
消息类型不支持
FileNotFound = 90_001
文件不存在
FileSizeExceeded = 90_002
文件大小超限
FileTypeNotSupported = 90_003
文件类型不支持
CalendarNotFound = 110_001
日历不存在
EventNotFound = 110_002
日程不存在
EventConflict = 110_003
日程冲突
DocumentNotFound = 120_001
文档不存在
DocumentPermissionDenied = 120_002
文档权限不足
DocumentLocked = 120_003
文档已锁定
SheetNotFound = 120_011
工作表不存在
TableNotFound = 120_021
表格不存在
AppNotPublished = 130_001
应用未发布
AppVersionIncompatible = 130_002
应用版本不兼容
NetworkTimeout = 999_001
网络连接超时
NetworkConnectionFailed = 999_002
网络连接失败
DnsResolutionFailed = 999_003
DNS解析失败
SslCertificateError = 999_004
SSL证书错误
Implementations§
Source§impl LarkErrorCode
impl LarkErrorCode
Sourcepub fn description(&self) -> &'static str
pub fn description(&self) -> &'static str
获取错误码的中文描述
Sourcepub fn detailed_description(&self) -> &'static str
pub fn detailed_description(&self) -> &'static str
获取详细的错误说明
Sourcepub fn is_auth_error(&self) -> bool
pub fn is_auth_error(&self) -> bool
检查是否为认证相关错误
Sourcepub fn is_permission_error(&self) -> bool
pub fn is_permission_error(&self) -> bool
检查是否为权限相关错误
Sourcepub fn is_client_error(&self) -> bool
pub fn is_client_error(&self) -> bool
检查是否为客户端错误
Sourcepub fn is_server_error(&self) -> bool
pub fn is_server_error(&self) -> bool
检查是否为服务器错误
Sourcepub fn is_retryable(&self) -> bool
pub fn is_retryable(&self) -> bool
检查是否可以重试
Sourcepub fn suggested_retry_delay(&self) -> Option<u64>
pub fn suggested_retry_delay(&self) -> Option<u64>
获取建议的重试延迟时间(秒)
Sourcepub fn severity(&self) -> ErrorSeverity
pub fn severity(&self) -> ErrorSeverity
获取错误的严重程度
Source§impl LarkErrorCode
impl LarkErrorCode
Sourcepub fn category(&self) -> ErrorCategory
pub fn category(&self) -> ErrorCategory
获取错误分类
Trait Implementations§
Source§impl Clone for LarkErrorCode
impl Clone for LarkErrorCode
Source§fn clone(&self) -> LarkErrorCode
fn clone(&self) -> LarkErrorCode
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for LarkErrorCode
impl Debug for LarkErrorCode
Source§impl Display for LarkErrorCode
impl Display for LarkErrorCode
Source§impl Hash for LarkErrorCode
impl Hash for LarkErrorCode
Source§impl PartialEq for LarkErrorCode
impl PartialEq for LarkErrorCode
impl Copy for LarkErrorCode
impl Eq for LarkErrorCode
impl StructuralPartialEq for LarkErrorCode
Auto Trait Implementations§
impl Freeze for LarkErrorCode
impl RefUnwindSafe for LarkErrorCode
impl Send for LarkErrorCode
impl Sync for LarkErrorCode
impl Unpin for LarkErrorCode
impl UnwindSafe for LarkErrorCode
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.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.