pub struct ErrorHelper;Expand description
错误处理助手工具
Implementations§
Source§impl ErrorHelper
impl ErrorHelper
Sourcepub fn handle_error(error: &LarkAPIError) -> ErrorHandlingAdvice
pub fn handle_error(error: &LarkAPIError) -> ErrorHandlingAdvice
根据错误类型提供智能处理建议
Sourcepub fn analyze_response<T>(
response: &BaseResponse<T>,
) -> Option<ErrorHandlingAdvice>
pub fn analyze_response<T>( response: &BaseResponse<T>, ) -> Option<ErrorHandlingAdvice>
根据响应创建处理建议
Sourcepub fn create_retry_strategy(error: &LarkAPIError) -> Option<RetryStrategy>
pub fn create_retry_strategy(error: &LarkAPIError) -> Option<RetryStrategy>
创建重试策略
Sourcepub fn format_user_error(error: &LarkAPIError) -> String
pub fn format_user_error(error: &LarkAPIError) -> String
格式化错误信息供用户显示
Sourcepub fn create_error_context(error: &LarkAPIError) -> ErrorContext
pub fn create_error_context(error: &LarkAPIError) -> ErrorContext
创建错误上下文信息
Auto Trait Implementations§
impl Freeze for ErrorHelper
impl RefUnwindSafe for ErrorHelper
impl Send for ErrorHelper
impl Sync for ErrorHelper
impl Unpin for ErrorHelper
impl UnwindSafe for ErrorHelper
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