pub enum ScribeError {
Show 15 variants
Io {
message: String,
source: Error,
},
Path {
message: String,
path: PathBuf,
source: Option<Error>,
},
Git {
message: String,
source: Option<Box<dyn Error + Send + Sync>>,
},
Config {
message: String,
field: Option<String>,
},
Analysis {
message: String,
file: PathBuf,
source: Option<Box<dyn Error + Send + Sync>>,
},
Scoring {
message: String,
context: Option<String>,
},
Graph {
message: String,
details: Option<String>,
},
Pattern {
message: String,
pattern: String,
source: Option<Box<dyn Error + Send + Sync>>,
},
Serialization {
message: String,
source: Option<Box<dyn Error + Send + Sync>>,
},
Concurrency {
message: String,
source: Option<Box<dyn Error + Send + Sync>>,
},
ResourceLimit {
message: String,
limit: u64,
actual: u64,
},
InvalidOperation {
message: String,
operation: String,
},
Parse {
message: String,
file: Option<PathBuf>,
source: Option<Box<dyn Error + Send + Sync>>,
},
Tokenization {
message: String,
source: Option<Box<dyn Error + Send + Sync>>,
},
Internal {
message: String,
location: Option<String>,
},
}
Expand description
Comprehensive error type for all Scribe operations
Variants§
Io
I/O related errors (file system operations)
Path
Path-related errors (invalid paths, path resolution issues)
Git
Git repository errors
Config
Configuration errors (invalid settings, missing required config)
Analysis
File analysis errors (parsing, language detection, etc.)
Scoring
Scoring and heuristic computation errors
Graph
Graph computation errors (centrality, dependency analysis)
Pattern
Pattern matching errors (glob patterns, regex, etc.)
Serialization
Serialization/deserialization errors
Concurrency
Thread pool or concurrency errors
ResourceLimit
Resource limit exceeded (memory, time, file size)
InvalidOperation
Invalid input or operation
Parse
Parse errors (AST parsing, tree-sitter failures)
Tokenization
Tokenization errors (tiktoken integration, encoding issues)
Internal
General internal errors (should not occur in normal operation)
Implementations§
Source§impl ScribeError
impl ScribeError
Sourcepub fn io<S: Into<String>>(message: S, source: Error) -> Self
pub fn io<S: Into<String>>(message: S, source: Error) -> Self
Create a new I/O error with context
Sourcepub fn path<S: Into<String>, P: Into<PathBuf>>(message: S, path: P) -> Self
pub fn path<S: Into<String>, P: Into<PathBuf>>(message: S, path: P) -> Self
Create a new path error with context
Sourcepub fn path_with_source<S: Into<String>, P: Into<PathBuf>>(
message: S,
path: P,
source: Error,
) -> Self
pub fn path_with_source<S: Into<String>, P: Into<PathBuf>>( message: S, path: P, source: Error, ) -> Self
Create a new path error with source error
Sourcepub fn config_field<S: Into<String>, F: Into<String>>(
message: S,
field: F,
) -> Self
pub fn config_field<S: Into<String>, F: Into<String>>( message: S, field: F, ) -> Self
Create a new configuration error with field context
Sourcepub fn analysis<S: Into<String>, P: Into<PathBuf>>(message: S, file: P) -> Self
pub fn analysis<S: Into<String>, P: Into<PathBuf>>(message: S, file: P) -> Self
Create a new analysis error
Sourcepub fn scoring_with_context<S: Into<String>, C: Into<String>>(
message: S,
context: C,
) -> Self
pub fn scoring_with_context<S: Into<String>, C: Into<String>>( message: S, context: C, ) -> Self
Create a new scoring error with context
Sourcepub fn pattern<S: Into<String>, P: Into<String>>(message: S, pattern: P) -> Self
pub fn pattern<S: Into<String>, P: Into<String>>(message: S, pattern: P) -> Self
Create a new pattern error
Sourcepub fn resource_limit<S: Into<String>>(
message: S,
limit: u64,
actual: u64,
) -> Self
pub fn resource_limit<S: Into<String>>( message: S, limit: u64, actual: u64, ) -> Self
Create a new resource limit error
Sourcepub fn invalid_operation<S: Into<String>, O: Into<String>>(
message: S,
operation: O,
) -> Self
pub fn invalid_operation<S: Into<String>, O: Into<String>>( message: S, operation: O, ) -> Self
Create a new invalid operation error
Sourcepub fn parse_file<S: Into<String>, P: Into<PathBuf>>(
message: S,
file: P,
) -> Self
pub fn parse_file<S: Into<String>, P: Into<PathBuf>>( message: S, file: P, ) -> Self
Create a new parse error with file context
Sourcepub fn parse_with_source<S: Into<String>>(
message: S,
source: Box<dyn Error + Send + Sync>,
) -> Self
pub fn parse_with_source<S: Into<String>>( message: S, source: Box<dyn Error + Send + Sync>, ) -> Self
Create a new parse error with source error
Sourcepub fn tokenization<S: Into<String>>(message: S) -> Self
pub fn tokenization<S: Into<String>>(message: S) -> Self
Create a new tokenization error