#[non_exhaustive]pub enum SailError {
Show 16 variants
Config {
message: String,
},
Internal {
message: String,
},
Transport {
kind: TransportKind,
message: String,
source: Option<Box<dyn StdError + Send + Sync + 'static>>,
},
Creation {
message: String,
status: u16,
body: Value,
},
NotFound {
message: String,
},
PermissionDenied {
message: String,
},
FileNotFound {
message: String,
},
InvalidArgument {
message: String,
},
Api {
status: u16,
message: String,
body: Value,
},
ExecRequestNotFound {
message: String,
},
Terminated {
message: String,
},
WorkerLost {
message: String,
},
ExecInterrupted {
retryable: bool,
message: String,
},
ExecCanceled {
message: String,
},
BrokenPipe {
message: String,
},
Execution {
code: GrpcCode,
detail: String,
},
}Expand description
The canonical Sail error. Variants carry structured fields so bindings can populate their own exception attributes without parsing strings.
Display is for Rust logs only; bindings format their own user-facing text.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Config
Configuration/usage error (e.g. missing API key, bad SAIL_MODE).
Internal
Unexpected internal failure (client build, TLS config, invariant).
Transport
HTTP/gRPC dial-time transport failure. source is the underlying
transport error (e.g. the originating tonic::Status) for Rust callers.
Fields
kind: TransportKindWhether the transport failed by timeout or by connection error.
Creation
Sailbox creation failed (non-2xx on create).
Fields
NotFound
A resource was not found (404 on get / unknown id across orgs).
PermissionDenied
A credential problem: missing/invalid API key or insufficient scope.
FileNotFound
A file operation referenced a path that does not exist.
InvalidArgument
A request argument was rejected as invalid.
Api
Any other non-2xx API response.
Fields
ExecRequestNotFound
A wait referenced an unknown exec request.
Terminated
The sailbox no longer exists on the worker.
WorkerLost
The worker hosting the sailbox was lost; output is unrecoverable.
ExecInterrupted
The command was interrupted; retryable indicates whether a retry
could still observe the result.
Fields
ExecCanceled
The command was canceled before producing an exit code.
BrokenPipe
A stdin write hit a command that already finished or closed its stdin.
Execution
Any other exec-RPC failure, classified by gRPC code.
Implementations§
Source§impl SailError
impl SailError
Sourcepub fn from_exec_status(status: &Status) -> SailError
pub fn from_exec_status(status: &Status) -> SailError
Classify an exec-context gRPC status into the canonical taxonomy.
NOT_FOUND splits into SailError::ExecRequestNotFound (the wait
referenced an unknown exec request) versus SailError::Terminated
(the sailbox itself is gone). A credential failure maps to
SailError::PermissionDenied, matching the listener/file mappers.
Everything else is a generic SailError::Execution carrying the
structured code; bindings format their own message from code + detail.
Sourcepub fn from_rpc_status(status: &Status) -> SailError
pub fn from_rpc_status(status: &Status) -> SailError
Classify a general (non-exec) worker-proxy gRPC status (listeners,
files). NOT_FOUND maps to SailError::NotFound, a credential failure
to SailError::PermissionDenied, and everything else to
SailError::Execution carrying the structured code.
Sourcepub fn from_file_rpc_status(status: &Status) -> SailError
pub fn from_file_rpc_status(status: &Status) -> SailError
Classify a file-RPC gRPC status. Files have their own taxonomy: a missing
path is SailError::FileNotFound (not the generic NotFound), and a
rejected argument is SailError::InvalidArgument.
Trait Implementations§
Source§impl Error for SailError
impl Error for SailError
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()
Auto Trait Implementations§
impl !RefUnwindSafe for SailError
impl !UnwindSafe for SailError
impl Freeze for SailError
impl Send for SailError
impl Sync for SailError
impl Unpin for SailError
impl UnsafeUnpin for SailError
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request