#[non_exhaustive]pub enum ErrorKind {
Transport {
message: String,
},
Timeout {
message: String,
},
Serialization {
message: String,
},
Streaming {
message: String,
},
RetryExhausted(RetryExhausted),
Api(ApiError),
InvalidConfig {
message: String,
},
}Expand description
EN: Top-level SDK error categories. 中文:SDK 顶层错误类别。
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Transport
EN: HTTP transport failed before a complete response was available. 中文:在完整响应可用前 HTTP 传输失败。
Timeout
EN: A configured timeout elapsed. 中文:配置的超时时间已耗尽。
Serialization
EN: Request serialization or response deserialization failed. 中文:请求序列化或响应反序列化失败。
Streaming
EN: Incremental stream parsing failed. 中文:增量流解析失败。
RetryExhausted(RetryExhausted)
EN: Retry policy exhausted all configured attempts. 中文:重试策略耗尽了所有配置的尝试次数。
Api(ApiError)
EN: OpenAI returned a non-successful API response. 中文:OpenAI 返回了非成功的 API 响应。
InvalidConfig
EN: SDK configuration or builder input is invalid. 中文:SDK 配置或构建器输入无效。
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ErrorKind
impl RefUnwindSafe for ErrorKind
impl Send for ErrorKind
impl Sync for ErrorKind
impl Unpin for ErrorKind
impl UnsafeUnpin for ErrorKind
impl UnwindSafe for ErrorKind
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