pub enum SessionError {
MessageAbortedError {
data: MessageAbortedErrorData,
},
ProviderAuthError {
data: ProviderAuthErrorData,
},
UnknownError {
data: UnknownErrorData,
},
MessageOutputLengthError {
data: Option<Value>,
},
StructuredOutputError {
data: StructuredOutputErrorData,
},
ContextOverflowError {
data: ContextOverflowErrorData,
},
APIError {
data: ApiErrorData,
},
}Expand description
A session-level error – one of the known error kinds.
Serialised with a "name" tag so the JSON representation matches the JS
SDK’s discriminated union: { "name": "ProviderAuthError", "data": … }.
Variants§
MessageAbortedError
The message was aborted by the user / system.
Fields
§
data: MessageAbortedErrorDataStructured error data.
ProviderAuthError
Provider authentication failed.
Fields
§
data: ProviderAuthErrorDataStructured error data.
UnknownError
A generic / unknown error.
Fields
§
data: UnknownErrorDataStructured error data.
MessageOutputLengthError
The message output exceeded the allowed length.
StructuredOutputError
Structured output validation failed.
Fields
§
data: StructuredOutputErrorDataStructured error data.
ContextOverflowError
The context window was exceeded.
Fields
§
data: ContextOverflowErrorDataStructured error data.
APIError
An error originating from the upstream API provider.
Fields
§
data: ApiErrorDataStructured error data.
Trait Implementations§
Source§impl Clone for SessionError
impl Clone for SessionError
Source§fn clone(&self) -> SessionError
fn clone(&self) -> SessionError
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 SessionError
impl Debug for SessionError
Source§impl<'de> Deserialize<'de> for SessionError
impl<'de> Deserialize<'de> for SessionError
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<ApiError> for SessionError
impl From<ApiError> for SessionError
Source§impl From<ContextOverflowError> for SessionError
impl From<ContextOverflowError> for SessionError
Source§fn from(e: ContextOverflowError) -> Self
fn from(e: ContextOverflowError) -> Self
Converts to this type from the input type.
Source§impl From<MessageAbortedError> for SessionError
impl From<MessageAbortedError> for SessionError
Source§fn from(e: MessageAbortedError) -> Self
fn from(e: MessageAbortedError) -> Self
Converts to this type from the input type.
Source§impl From<MessageOutputLengthError> for SessionError
impl From<MessageOutputLengthError> for SessionError
Source§fn from(e: MessageOutputLengthError) -> Self
fn from(e: MessageOutputLengthError) -> Self
Converts to this type from the input type.
Source§impl From<ProviderAuthError> for SessionError
impl From<ProviderAuthError> for SessionError
Source§fn from(e: ProviderAuthError) -> Self
fn from(e: ProviderAuthError) -> Self
Converts to this type from the input type.
Source§impl From<StructuredOutputError> for SessionError
impl From<StructuredOutputError> for SessionError
Source§fn from(e: StructuredOutputError) -> Self
fn from(e: StructuredOutputError) -> Self
Converts to this type from the input type.
Source§impl From<UnknownError> for SessionError
impl From<UnknownError> for SessionError
Source§fn from(e: UnknownError) -> Self
fn from(e: UnknownError) -> Self
Converts to this type from the input type.
Source§impl PartialEq for SessionError
impl PartialEq for SessionError
Source§impl Serialize for SessionError
impl Serialize for SessionError
impl StructuralPartialEq for SessionError
Auto Trait Implementations§
impl Freeze for SessionError
impl RefUnwindSafe for SessionError
impl Send for SessionError
impl Sync for SessionError
impl Unpin for SessionError
impl UnwindSafe for SessionError
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