#[non_exhaustive]pub enum Error {
HarnessNotFound,
HarnessNotExecutable {
path: PathBuf,
source: Error,
},
HandshakeFailed {
stderr: String,
},
Handshake(DecodeError),
WebSocketUnreachable {
port: u16,
attempts: u32,
},
WebSocket(Box<Error>),
Decode {
source: Error,
raw: String,
},
SessionClosed,
Turn {
message: String,
},
Io(Error),
}Expand description
Anything that can go wrong driving a localharness process.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
HarnessNotFound
The localharness binary could not be located.
It ships only inside the platform wheels published to PyPI, so there is
no package manager that will put it on PATH for you — see
crate::process::find_harness.
HarnessNotExecutable
The configured binary path does not exist or is not executable.
HandshakeFailed
The harness exited before completing the stdio handshake.
stderr is included because the harness reports configuration problems
there and then exits, rather than replying on the wire.
Handshake(DecodeError)
The handshake reply could not be parsed.
WebSocketUnreachable
The WebSocket never accepted a connection on the port the harness reported.
WebSocket(Box<Error>)
async-client only.The WebSocket closed or failed mid-session.
Boxed because tungstenite::Error is by far the largest thing this enum
carries, and every fallible call in the crate returns this type.
Decode
A frame arrived that this crate could not decode.
The raw text is retained: unlike an unknown enum value or an unknown
oneof arm — both of which decode fine by design — this means the frame
is structurally unexpected, and the payload is what makes it reportable.
SessionClosed
The session ended while a caller was waiting on it.
Turn
The agent stopped without completing the turn.
Raised after the turn’s steps have been delivered, so whatever the agent managed to say before failing has already been seen.
Io(Error)
Underlying process or socket I/O failed.
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()