ScribeError

Enum ScribeError 

Source
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)

Fields

§message: String
§source: Error
§

Path

Path-related errors (invalid paths, path resolution issues)

Fields

§message: String
§path: PathBuf
§source: Option<Error>
§

Git

Git repository errors

Fields

§message: String
§source: Option<Box<dyn Error + Send + Sync>>
§

Config

Configuration errors (invalid settings, missing required config)

Fields

§message: String
§

Analysis

File analysis errors (parsing, language detection, etc.)

Fields

§message: String
§file: PathBuf
§source: Option<Box<dyn Error + Send + Sync>>
§

Scoring

Scoring and heuristic computation errors

Fields

§message: String
§context: Option<String>
§

Graph

Graph computation errors (centrality, dependency analysis)

Fields

§message: String
§details: Option<String>
§

Pattern

Pattern matching errors (glob patterns, regex, etc.)

Fields

§message: String
§pattern: String
§source: Option<Box<dyn Error + Send + Sync>>
§

Serialization

Serialization/deserialization errors

Fields

§message: String
§source: Option<Box<dyn Error + Send + Sync>>
§

Concurrency

Thread pool or concurrency errors

Fields

§message: String
§source: Option<Box<dyn Error + Send + Sync>>
§

ResourceLimit

Resource limit exceeded (memory, time, file size)

Fields

§message: String
§limit: u64
§actual: u64
§

InvalidOperation

Invalid input or operation

Fields

§message: String
§operation: String
§

Parse

Parse errors (AST parsing, tree-sitter failures)

Fields

§message: String
§source: Option<Box<dyn Error + Send + Sync>>
§

Tokenization

Tokenization errors (tiktoken integration, encoding issues)

Fields

§message: String
§source: Option<Box<dyn Error + Send + Sync>>
§

Internal

General internal errors (should not occur in normal operation)

Fields

§message: String
§location: Option<String>

Implementations§

Source§

impl ScribeError

Source

pub fn io<S: Into<String>>(message: S, source: Error) -> Self

Create a new I/O error with context

Source

pub fn path<S: Into<String>, P: Into<PathBuf>>(message: S, path: P) -> Self

Create a new path error with context

Source

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

Source

pub fn git<S: Into<String>>(message: S) -> Self

Create a new git error

Source

pub fn config<S: Into<String>>(message: S) -> Self

Create a new configuration error

Source

pub fn config_field<S: Into<String>, F: Into<String>>( message: S, field: F, ) -> Self

Create a new configuration error with field context

Source

pub fn analysis<S: Into<String>, P: Into<PathBuf>>(message: S, file: P) -> Self

Create a new analysis error

Source

pub fn scoring<S: Into<String>>(message: S) -> Self

Create a new scoring error

Source

pub fn scoring_with_context<S: Into<String>, C: Into<String>>( message: S, context: C, ) -> Self

Create a new scoring error with context

Source

pub fn graph<S: Into<String>>(message: S) -> Self

Create a new graph computation error

Source

pub fn pattern<S: Into<String>, P: Into<String>>(message: S, pattern: P) -> Self

Create a new pattern error

Source

pub fn resource_limit<S: Into<String>>( message: S, limit: u64, actual: u64, ) -> Self

Create a new resource limit error

Source

pub fn invalid_operation<S: Into<String>, O: Into<String>>( message: S, operation: O, ) -> Self

Create a new invalid operation error

Source

pub fn internal<S: Into<String>>(message: S) -> Self

Create a new internal error

Source

pub fn parse<S: Into<String>>(message: S) -> Self

Create a new parse error

Source

pub fn parse_file<S: Into<String>, P: Into<PathBuf>>( message: S, file: P, ) -> Self

Create a new parse error with file context

Source

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

Source

pub fn tokenization<S: Into<String>>(message: S) -> Self

Create a new tokenization error

Source

pub fn tokenization_with_source<S: Into<String>>( message: S, source: Box<dyn Error + Send + Sync>, ) -> Self

Create a new tokenization error with source

Source

pub fn internal_with_location<S: Into<String>, L: Into<String>>( message: S, location: L, ) -> Self

Create a new internal error with location

Trait Implementations§

Source§

impl Debug for ScribeError

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for ScribeError

Source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Error for ScribeError

Source§

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

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl From<Error> for ScribeError

Source§

fn from(error: Error) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for ScribeError

Source§

fn from(error: Error) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for ScribeError

Source§

fn from(error: Error) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for ScribeError

Source§

fn from(error: Error) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.