pub enum FileSystemErrorClass {
NotFound,
ReadOnly,
IsADirectory,
NotADirectory,
NotEmpty,
Other,
}Expand description
Typed classification of a SessionFileSystem failure.
The file-system tools (crates/core/src/capabilities/file_system.rs) decide
whether a failure is a tool error (surfaced to the agent verbatim — bad
input it can correct) or an internal error (logged, generic copy). They
previously made that call with msg.contains("readonly") / "is a directory" / "not found" style sniffs against the stringified error.
The SessionFileSystem trait returns anyhow::Result<T> and has 10+
implementors across crates, so widening the trait’s error type is out of
scope. Instead, classify_fs_error gives a single typed seam: it
downcasts to FileSystemError when an implementor opts in, and otherwise
falls back to the legacy substring heuristics in one place. Implementors can
migrate to returning FileSystemError (via anyhow::Error::new)
incrementally without changing behavior.
Variants§
NotFound
The target (or a path component) does not exist.
ReadOnly
The target is read-only and cannot be written or deleted.
IsADirectory
Expected a file but the path is a directory.
NotADirectory
Expected a directory but the path is not one.
NotEmpty
A non-recursive delete refused a non-empty directory.
Other
No recognized client-correctable condition; treat as internal.
Trait Implementations§
Source§impl Clone for FileSystemErrorClass
impl Clone for FileSystemErrorClass
Source§fn clone(&self) -> FileSystemErrorClass
fn clone(&self) -> FileSystemErrorClass
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more