pub enum CodeError {
CompileError {
diagnostics: Vec<RustDiagnostic>,
stderr: String,
},
DependencyNotFound {
name: String,
searched: Vec<String>,
},
Sandbox(SandboxError),
InvalidCode(String),
}Expand description
Errors from the language-aware code pipeline ([RustExecutor]).
Unlike ExecutionError (which covers the legacy executor), CodeError
carries structured diagnostics for compile failures and distinguishes
missing dependencies from sandbox-level failures.
§Example
use adk_code::CodeError;
let err = CodeError::InvalidCode("missing `fn run()` entry point".to_string());
assert!(err.to_string().contains("invalid code"));Variants§
CompileError
Compilation produced one or more error-level diagnostics.
Fields
§
diagnostics: Vec<RustDiagnostic>Structured diagnostics parsed from --error-format=json.
DependencyNotFound
A required dependency could not be located on disk.
Fields
Sandbox(SandboxError)
The underlying sandbox backend returned an error.
InvalidCode(String)
The source code is invalid before compilation is attempted.
Trait Implementations§
Source§impl Error for CodeError
impl Error for CodeError
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<SandboxError> for CodeError
impl From<SandboxError> for CodeError
Source§fn from(source: SandboxError) -> Self
fn from(source: SandboxError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for CodeError
impl RefUnwindSafe for CodeError
impl Send for CodeError
impl Sync for CodeError
impl Unpin for CodeError
impl UnsafeUnpin for CodeError
impl UnwindSafe for CodeError
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
Mutably borrows from an owned value. Read more