LarkErrorCode

Enum LarkErrorCode 

Source
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

请求参数错误

§

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

DNS解析失败

§

SslCertificateError = 999_004

SSL证书错误

Implementations§

Source§

impl LarkErrorCode

Source

pub fn from_code(code: i32) -> Option<Self>

从错误码数值创建枚举

Source

pub fn description(&self) -> &'static str

获取错误码的中文描述

Source

pub fn detailed_description(&self) -> &'static str

获取详细的错误说明

Source

pub fn is_auth_error(&self) -> bool

检查是否为认证相关错误

Source

pub fn is_permission_error(&self) -> bool

检查是否为权限相关错误

Source

pub fn is_client_error(&self) -> bool

检查是否为客户端错误

Source

pub fn is_server_error(&self) -> bool

检查是否为服务器错误

Source

pub fn is_retryable(&self) -> bool

检查是否可以重试

Source

pub fn suggested_retry_delay(&self) -> Option<u64>

获取建议的重试延迟时间(秒)

Source

pub fn severity(&self) -> ErrorSeverity

获取错误的严重程度

Source

pub fn help_url(&self) -> Option<&'static str>

获取相关的帮助文档链接

Source§

impl LarkErrorCode

Source

pub fn category(&self) -> ErrorCategory

获取错误分类

Trait Implementations§

Source§

impl Clone for LarkErrorCode

Source§

fn clone(&self) -> LarkErrorCode

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for LarkErrorCode

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for LarkErrorCode

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Hash for LarkErrorCode

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for LarkErrorCode

Source§

fn eq(&self, other: &LarkErrorCode) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Copy for LarkErrorCode

Source§

impl Eq for LarkErrorCode

Source§

impl StructuralPartialEq for LarkErrorCode

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T> ToStringFallible for T
where T: Display,

Source§

fn try_to_string(&self) -> Result<String, TryReserveError>

ToString::to_string, but without panic on OOM.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,