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 moreimpl Copy for FileSystemErrorClass
Source§impl Debug for FileSystemErrorClass
impl Debug for FileSystemErrorClass
impl Eq for FileSystemErrorClass
Source§impl PartialEq for FileSystemErrorClass
impl PartialEq for FileSystemErrorClass
impl StructuralPartialEq for FileSystemErrorClass
Auto Trait Implementations§
impl Freeze for FileSystemErrorClass
impl RefUnwindSafe for FileSystemErrorClass
impl Send for FileSystemErrorClass
impl Sync for FileSystemErrorClass
impl Unpin for FileSystemErrorClass
impl UnsafeUnpin for FileSystemErrorClass
impl UnwindSafe for FileSystemErrorClass
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
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