pub enum CodingError {
File(FileError),
Bash(BashError),
Grep(GrepError),
AstGrep(AstGrepError),
Find(FindError),
ListFiles(ListFilesError),
WebFetch(WebFetchError),
WebSearch(WebSearchError),
NotConfigured(String),
}Expand description
Error types for all coding tool operations.
CodingError is the top-level enum returned by CodingTools methods and the tools exposed by CodingMcp. Each variant wraps a more specific error type.
§Variants
File– File read, write, or edit failures (FileError).Bash– Shell command execution failures (BashError).Grep– Regex search failures (GrepError).AstGrep– Structural AST search failures (AstGrepError).Find– Glob-based file discovery failures (FindError).ListFiles– Directory listing failures (ListFilesError).WebFetch– URL fetch failures (WebFetchError).WebSearch– Web search API failures (WebSearchError).NotConfigured– A tool was called that requires configuration not present (e.g. web search without a Brave API key).
§Sub-error types
FileError–NotFound,ReadFailed,WriteFailed,CreateDirFailed,InvalidOffset,PatternNotFound,Io.BashError–Forbidden,TimeoutTooLarge,SpawnFailed,InvalidRegex,JoinFailed,ShellNotFound,WaitFailed.GlobError–InvalidPattern,BuildFailed(shared by the search tools).GrepError–Glob,InvalidRegex,SearchFailed,PathNotFound.AstGrepError–PathNotFound,Glob,UnsupportedLanguage,InvalidPattern,ReadFailed,SearchFailed.FindError–PathNotFound,InvalidGlobPattern,LockFailed.ListFilesError–ReadDirFailed,ReadEntryFailed,MetadataFailed.WebFetchError–InvalidUrl,RequestFailed,Timeout,ResponseTooLarge,ParseFailed.WebSearchError–InvalidQuery,ApiError,RateLimited,Timeout,ConfigError,ParseError.
Variants§
File(FileError)
File operation errors (read, write, edit)
Bash(BashError)
Bash command execution errors
Grep(GrepError)
Grep search errors
AstGrep(AstGrepError)
ast-grep structural search errors
Find(FindError)
Find file errors
ListFiles(ListFilesError)
List files errors
WebFetch(WebFetchError)
Web fetch errors
WebSearch(WebSearchError)
Web search errors
NotConfigured(String)
Tool not configured/available
Trait Implementations§
Source§impl Debug for CodingError
impl Debug for CodingError
Source§impl Display for CodingError
impl Display for CodingError
Source§impl Error for CodingError
impl Error for CodingError
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<AstGrepError> for CodingError
impl From<AstGrepError> for CodingError
Source§fn from(source: AstGrepError) -> Self
fn from(source: AstGrepError) -> Self
Converts to this type from the input type.
Source§impl From<BashError> for CodingError
impl From<BashError> for CodingError
Source§impl From<FileError> for CodingError
impl From<FileError> for CodingError
Source§impl From<FindError> for CodingError
impl From<FindError> for CodingError
Source§impl From<GrepError> for CodingError
impl From<GrepError> for CodingError
Source§impl From<ListFilesError> for CodingError
impl From<ListFilesError> for CodingError
Source§fn from(source: ListFilesError) -> Self
fn from(source: ListFilesError) -> Self
Converts to this type from the input type.
Source§impl From<WebFetchError> for CodingError
impl From<WebFetchError> for CodingError
Source§fn from(source: WebFetchError) -> Self
fn from(source: WebFetchError) -> Self
Converts to this type from the input type.
Source§impl From<WebSearchError> for CodingError
impl From<WebSearchError> for CodingError
Source§fn from(source: WebSearchError) -> Self
fn from(source: WebSearchError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl !RefUnwindSafe for CodingError
impl !UnwindSafe for CodingError
impl Freeze for CodingError
impl Send for CodingError
impl Sync for CodingError
impl Unpin for CodingError
impl UnsafeUnpin for CodingError
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