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>(message: S, source: Error) -> ScribeError
pub fn io<S>(message: S, source: Error) -> ScribeError
Create a new I/O error with context
Sourcepub fn path<S, P>(message: S, path: P) -> ScribeError
pub fn path<S, P>(message: S, path: P) -> ScribeError
Create a new path error with context
Sourcepub fn path_with_source<S, P>(message: S, path: P, source: Error) -> ScribeError
pub fn path_with_source<S, P>(message: S, path: P, source: Error) -> ScribeError
Create a new path error with source error
Sourcepub fn git<S>(message: S) -> ScribeError
pub fn git<S>(message: S) -> ScribeError
Create a new git error
Sourcepub fn config<S>(message: S) -> ScribeError
pub fn config<S>(message: S) -> ScribeError
Create a new configuration error
Sourcepub fn config_field<S, F>(message: S, field: F) -> ScribeError
pub fn config_field<S, F>(message: S, field: F) -> ScribeError
Create a new configuration error with field context
Sourcepub fn analysis<S, P>(message: S, file: P) -> ScribeError
pub fn analysis<S, P>(message: S, file: P) -> ScribeError
Create a new analysis error
Sourcepub fn scoring<S>(message: S) -> ScribeError
pub fn scoring<S>(message: S) -> ScribeError
Create a new scoring error
Sourcepub fn scoring_with_context<S, C>(message: S, context: C) -> ScribeError
pub fn scoring_with_context<S, C>(message: S, context: C) -> ScribeError
Create a new scoring error with context
Sourcepub fn graph<S>(message: S) -> ScribeError
pub fn graph<S>(message: S) -> ScribeError
Create a new graph computation error
Sourcepub fn pattern<S, P>(message: S, pattern: P) -> ScribeError
pub fn pattern<S, P>(message: S, pattern: P) -> ScribeError
Create a new pattern error
Sourcepub fn resource_limit<S>(message: S, limit: u64, actual: u64) -> ScribeError
pub fn resource_limit<S>(message: S, limit: u64, actual: u64) -> ScribeError
Create a new resource limit error
Sourcepub fn invalid_operation<S, O>(message: S, operation: O) -> ScribeError
pub fn invalid_operation<S, O>(message: S, operation: O) -> ScribeError
Create a new invalid operation error
Sourcepub fn internal<S>(message: S) -> ScribeError
pub fn internal<S>(message: S) -> ScribeError
Create a new internal error
Sourcepub fn parse<S>(message: S) -> ScribeError
pub fn parse<S>(message: S) -> ScribeError
Create a new parse error
Sourcepub fn parse_file<S, P>(message: S, file: P) -> ScribeError
pub fn parse_file<S, P>(message: S, file: P) -> ScribeError
Create a new parse error with file context
Sourcepub fn parse_with_source<S>(
message: S,
source: Box<dyn Error + Send + Sync>,
) -> ScribeError
pub fn parse_with_source<S>( message: S, source: Box<dyn Error + Send + Sync>, ) -> ScribeError
Create a new parse error with source error
Sourcepub fn tokenization<S>(message: S) -> ScribeError
pub fn tokenization<S>(message: S) -> ScribeError
Create a new tokenization error
Sourcepub fn tokenization_with_source<S>(
message: S,
source: Box<dyn Error + Send + Sync>,
) -> ScribeError
pub fn tokenization_with_source<S>( message: S, source: Box<dyn Error + Send + Sync>, ) -> ScribeError
Create a new tokenization error with source
Sourcepub fn internal_with_location<S, L>(message: S, location: L) -> ScribeError
pub fn internal_with_location<S, L>(message: S, location: L) -> ScribeError
Create a new internal error with location
Trait Implementations§
Source§impl Debug for ScribeError
impl Debug for ScribeError
Source§impl Display for ScribeError
impl Display for ScribeError
Source§impl Error for ScribeError
impl Error for ScribeError
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
Source§impl From<Error> for ScribeError
impl From<Error> for ScribeError
Source§fn from(error: Error) -> ScribeError
fn from(error: Error) -> ScribeError
Source§impl From<Error> for ScribeError
impl From<Error> for ScribeError
Source§fn from(error: Error) -> ScribeError
fn from(error: Error) -> ScribeError
Source§impl From<Error> for ScribeError
impl From<Error> for ScribeError
Source§fn from(error: Error) -> ScribeError
fn from(error: Error) -> ScribeError
Source§impl From<Error> for ScribeError
impl From<Error> for ScribeError
Source§fn from(error: Error) -> ScribeError
fn from(error: Error) -> ScribeError
Auto Trait Implementations§
impl Freeze for ScribeError
impl !RefUnwindSafe for ScribeError
impl Send for ScribeError
impl Sync for ScribeError
impl Unpin for ScribeError
impl !UnwindSafe for ScribeError
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
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more