pub enum SandboxError {
Timeout {
timeout: Duration,
},
MemoryExceeded {
limit_mb: u32,
},
ExecutionFailed(String),
InvalidRequest(String),
BackendUnavailable(String),
EnforcerFailed {
enforcer: String,
message: String,
},
EnforcerUnavailable {
enforcer: String,
message: String,
},
PolicyViolation(String),
}Available on crate feature
sandbox only.Expand description
Errors that can occur during sandbox execution.
All variants include actionable context to help callers diagnose issues.
§Example
use adk_sandbox::SandboxError;
use std::time::Duration;
let err = SandboxError::Timeout { timeout: Duration::from_secs(30) };
assert!(err.to_string().contains("30s"));Variants§
Timeout
Execution exceeded the configured timeout.
MemoryExceeded
Execution exceeded the configured memory limit (Wasm only).
ExecutionFailed(String)
Execution failed due to an internal error (e.g., subprocess I/O failure).
InvalidRequest(String)
The request is invalid (e.g., unsupported language for this backend).
The backend is not available (e.g., missing runtime or feature not enabled).
EnforcerFailed
The sandbox enforcer failed to apply the profile.
Fields
The sandbox enforcer is not available on this system.
PolicyViolation(String)
A policy path or resource could not be resolved.
Trait Implementations§
Source§impl Clone for SandboxError
impl Clone for SandboxError
Source§fn clone(&self) -> SandboxError
fn clone(&self) -> SandboxError
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SandboxError
impl Debug for SandboxError
Source§impl Display for SandboxError
impl Display for SandboxError
Source§impl Error for SandboxError
impl Error for SandboxError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl From<Error> for SandboxError
impl From<Error> for SandboxError
Source§fn from(err: Error) -> SandboxError
fn from(err: Error) -> SandboxError
Converts to this type from the input type.
Source§impl From<SandboxError> for AdkError
impl From<SandboxError> for AdkError
Source§fn from(err: SandboxError) -> AdkError
fn from(err: SandboxError) -> AdkError
Converts to this type from the input type.
Source§impl From<SandboxError> for CodeError
impl From<SandboxError> for CodeError
Source§fn from(source: SandboxError) -> CodeError
fn from(source: SandboxError) -> CodeError
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for SandboxError
impl RefUnwindSafe for SandboxError
impl Send for SandboxError
impl Sync for SandboxError
impl Unpin for SandboxError
impl UnsafeUnpin for SandboxError
impl UnwindSafe for SandboxError
Blanket Implementations§
Source§impl<T> AsErrorSource for Twhere
T: Error + 'static,
impl<T> AsErrorSource for Twhere
T: Error + 'static,
Source§fn as_error_source(&self) -> &(dyn Error + 'static)
fn as_error_source(&self) -> &(dyn Error + 'static)
For maximum effectiveness, this needs to be called as a method
to benefit from Rust’s automatic dereferencing of method
receivers.
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.