Enum StreamError
pub enum StreamError {
Http(String),
ConnectFailed(String),
Json(Error),
InvalidSse(String),
ModelProvider(String),
HttpStatus {
status: u16,
message: String,
},
ModelRefusal(Box<ModelRefusalError>),
Terminal(Box<dyn Error + Send + Sync>),
Io(Error),
}Expand description
Errors that can occur during streaming.
Variants§
Http(String)
ConnectFailed(String)
The connection for the failing request hop could not be opened (connect, TLS handshake or DNS), as reported by the transport at the send site. For a request that followed no redirect, nothing was delivered. A redirect-following client may already have delivered an earlier hop; callers that must not re-send delivered work cannot rely on this variant alone.
The display text matches StreamError::Http so logs, diagnostics
and user-facing messages are unchanged.
Json(Error)
InvalidSse(String)
ModelProvider(String)
HttpStatus
A provider returned a non-success HTTP response before streaming began.
ModelRefusal(Box<ModelRefusalError>)
Terminal(Box<dyn Error + Send + Sync>)
The provider already exhausted its own retry/fallback budget producing this error; consumers must not retry or fall back. Produced only when a completed non-streaming call is synthesized into a stream (the wrapped failure already survived the full ladder). A genuine streaming leg never emits it, so fallback recovery for streamed failures is unaffected. The payload is the completed call’s failure; consumers walk its chain for the typed terminal cause beneath it.
Io(Error)
Trait Implementations§
Source§impl Debug for StreamError
impl Debug for StreamError
Source§impl Display for StreamError
impl Display for StreamError
Source§impl Error for StreamError
impl Error for StreamError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · §fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Source§impl From<Box<ModelRefusalError>> for StreamError
impl From<Box<ModelRefusalError>> for StreamError
Source§fn from(source: Box<ModelRefusalError>) -> StreamError
fn from(source: Box<ModelRefusalError>) -> StreamError
Source§impl From<Error> for StreamError
impl From<Error> for StreamError
Source§fn from(source: Error) -> StreamError
fn from(source: Error) -> StreamError
Auto Trait Implementations§
impl !RefUnwindSafe for StreamError
impl !UnwindSafe for StreamError
impl Freeze for StreamError
impl Send for StreamError
impl Sync for StreamError
impl Unpin for StreamError
impl UnsafeUnpin for StreamError
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more