pub enum PathfinderError {
Show 13 variants
FileNotFound {
path: PathBuf,
},
SymbolNotFound {
semantic_path: String,
did_you_mean: Vec<String>,
},
InvalidSemanticPath {
input: String,
issue: String,
},
AmbiguousSymbol {
semantic_path: String,
matches: Vec<String>,
},
NoLspAvailable {
language: String,
},
LspError {
message: String,
},
IoError {
message: String,
},
LspTimeout {
timeout_ms: u64,
},
AccessDenied {
path: PathBuf,
tier: SandboxTier,
},
ParseError {
path: PathBuf,
reason: String,
},
UnsupportedLanguage {
path: PathBuf,
},
TokenBudgetExceeded {
used: usize,
budget: usize,
},
PathTraversal {
path: PathBuf,
workspace_root: PathBuf,
},
}Expand description
A standardized error type for Pathfinder operations.
Variants§
FileNotFound
File path doesn’t exist.
SymbolNotFound
Semantic path doesn’t resolve.
Fields
InvalidSemanticPath
Semantic path is malformed or missing required ‘::’ separator.
AmbiguousSymbol
Multiple matches for a semantic path.
Fields
NoLspAvailable
No language server available for this file type.
LspError
Language server crashed or returned an error.
IoError
A generic I/O error occurred.
LspTimeout
LSP didn’t respond within timeout.
AccessDenied
File is in the sandbox deny-list.
ParseError
Tree-sitter couldn’t parse the file.
UnsupportedLanguage
The language of the semantic path’s file is not supported.
TokenBudgetExceeded
Response would exceed max_tokens.
PathTraversal
Path traversal detected in resolve_strict.
Implementations§
Source§impl PathfinderError
impl PathfinderError
Sourcepub const fn error_code(&self) -> &'static str
pub const fn error_code(&self) -> &'static str
Returns the MCP-facing error code string.
Sourcepub fn hint(&self) -> Option<String>
pub fn hint(&self) -> Option<String>
Returns an actionable hint for the agent to self-correct without additional round-trips.
SYMBOL_NOT_FOUND hints are dynamic and built from the did_you_mean suggestions.
All other hints are static strings referencing specific Pathfinder tools.
Sourcepub fn to_error_response(&self) -> ErrorResponse
pub fn to_error_response(&self) -> ErrorResponse
Serialize to the standard MCP error JSON format.
Trait Implementations§
Source§impl Debug for PathfinderError
impl Debug for PathfinderError
Source§impl Display for PathfinderError
impl Display for PathfinderError
Source§impl Error for PathfinderError
impl Error for PathfinderError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()