#[non_exhaustive]pub enum ChainError {
MissingInput(String),
InputError(String),
OutputError(String),
ExecutionError(String),
StreamError(String),
Other(String),
Nested {
context: String,
source: Box<dyn Error + Send + Sync>,
},
}Expand description
Chain error type.
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.
MissingInput(String)
Missing input.
InputError(String)
Input error (present but malformed — e.g. a document that fails to deserialize).
OutputError(String)
Output error.
ExecutionError(String)
Execution error.
StreamError(String)
Stream error.
Other(String)
Other error.
Nested
Nested (sub-chain / LLM) execution error, preserving the original error chain.
P2-1: composite chains (SequentialChain / RouterChain) wrap sub-chain or
LLM failures in this variant so the underlying error stays inspectable
via source() (e.g. downcast back to a concrete ChainError variant)
instead of being flattened into a string by format!.
Trait Implementations§
Source§impl Debug for ChainError
impl Debug for ChainError
Source§impl Display for ChainError
impl Display for ChainError
Source§impl Error for ChainError
impl Error for ChainError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl From<ChainError> for LcelError
Allow ChainError to convert into LcelError.
impl From<ChainError> for LcelError
Allow ChainError to convert into LcelError.
Source§fn from(err: ChainError) -> Self
fn from(err: ChainError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl !RefUnwindSafe for ChainError
impl !UnwindSafe for ChainError
impl Freeze for ChainError
impl Send for ChainError
impl Sync for ChainError
impl Unpin for ChainError
impl UnsafeUnpin for ChainError
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