pub enum Error {
Transport(Box<Error>),
ConnectionClosed {
context: &'static str,
},
InvalidUrl(ParseError),
Protocol(String),
Json(Box<Error>),
RetriesExhausted {
attempts: u32,
last_error: String,
},
BotDecision(String),
UntrustedGateway(String),
}Expand description
Top-level error type for SDK operations. Variants describe the failure surface in terms users care about (connect failed, server dropped us mid-handshake, peer sent something unparseable) rather than transport internals.
Large variants (Transport, Json) are boxed so Result<T, Error>
stays small on the success path. The boxing is invisible to callers
thanks to the From impls below.
Variants§
Transport(Box<Error>)
ConnectionClosed
InvalidUrl(ParseError)
Protocol(String)
Json(Box<Error>)
RetriesExhausted
BotDecision(String)
Raised when bot.decide() panics and safe_mode is off.
Distinguished from transport/connection errors so the caller treats it as terminal (a deterministic bot bug, not a transient disconnect) and does NOT reconnect-retry it. See chipzen-ai/chipzen-sdk#52.
UntrustedGateway(String)
Raised when a server-supplied gateway URL is cross-origin relative to
the lobby, or downgrades wss to ws. Refused so the bot token is
never sent to a different host or in cleartext.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()