#[non_exhaustive]pub enum SailError {
Show 15 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,
},
ImageBuild {
message: String,
},
Api {
status: u16,
message: String,
body: Value,
},
ExecRequestNotFound {
message: String,
},
Terminated {
message: String,
},
HostLost {
message: String,
},
BrokenPipe {
message: String,
},
Execution {
code: RpcStatus,
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. a missing API key).
Internal
Unexpected internal failure (client build, TLS config, invariant).
Transport
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.
ImageBuild
A custom image build failed (the build reported failed).
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.
HostLost
The host machine running the Sailbox was lost; output is unrecoverable.
BrokenPipe
A stdin write hit a command that already finished or closed its stdin.
Execution
Any other exec-RPC failure, classified by RPC status code.
Implementations§
Source§impl SailError
impl SailError
Sourcepub fn retryable(&self) -> bool
pub fn retryable(&self) -> bool
Whether retrying the same call may succeed, so autonomous callers can
branch without matching variants or parsing messages. Advisory and
conservative: true for transport failures, HTTP 429 and gateway
statuses (502-504), and unavailable/aborted/deadline-exceeded
RPC failures; false everywhere the failure is deterministic (bad
argument, missing resource, permission). resource-exhausted stays
false even though its HTTP twin 429 is true: gRPC surfaces
deterministic message-size violations under the same code as rate
limits, so it cannot be classified as transient. The SDK’s built-in
retry already covers the transient window for most calls; this
classifies what leaks past it.
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