pub enum CtxError {
Show 22 variants
Database(Error),
Analytics(Error),
Io(Error),
Readline(ReadlineError),
Serialization(Error),
Network(Error),
Embedding(String),
RateLimited(u64),
InvalidApiKey,
ModelNotFound(String),
DimensionMismatch {
expected: usize,
actual: usize,
},
Git(String),
NotGitRepo,
InvalidRevision(String),
NoChanges,
NoMatches,
IndexNotFound(String),
SchemaVersionMismatch {
found: i64,
expected: i64,
},
ParseError(String),
TokenCount(String),
FileRead {
path: String,
message: String,
},
Other(String),
}Expand description
Unified error type for all ctx operations.
Variants§
Database(Error)
SQLite database error.
Analytics(Error)
DuckDB analytics error.
Io(Error)
File system or IO error.
Readline(ReadlineError)
Readline/shell input error.
Serialization(Error)
JSON serialization/deserialization error.
Network(Error)
HTTP request error.
Embedding(String)
Generic embedding operation error.
RateLimited(u64)
API rate limit exceeded.
InvalidApiKey
Invalid or missing API key.
ModelNotFound(String)
Embedding model not found.
DimensionMismatch
Vector dimension mismatch.
Git(String)
Git command or operation error.
NotGitRepo
Not inside a git repository.
InvalidRevision(String)
Invalid git revision or reference.
NoChanges
No changes found in diff.
NoMatches
No relevant files found for smart context.
IndexNotFound(String)
Index database not found.
SchemaVersionMismatch
The on-disk index was created with a different schema version.
ParseError(String)
Parse error during code analysis.
TokenCount(String)
Token counting error.
FileRead
File read error with path context.
Other(String)
Generic error for cases not covered above.
Implementations§
Source§impl CtxError
impl CtxError
Sourcepub fn embedding(msg: impl Into<String>) -> Self
pub fn embedding(msg: impl Into<String>) -> Self
Create an embedding error from a string message.
Sourcepub fn token_count(msg: impl Into<String>) -> Self
pub fn token_count(msg: impl Into<String>) -> Self
Create a token count error from a string message.
Trait Implementations§
Source§impl Error for CtxError
impl Error for CtxError
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()
Source§impl From<ReadlineError> for CtxError
impl From<ReadlineError> for CtxError
Source§fn from(source: ReadlineError) -> Self
fn from(source: ReadlineError) -> Self
Auto Trait Implementations§
impl !RefUnwindSafe for CtxError
impl !UnwindSafe for CtxError
impl Freeze for CtxError
impl Send for CtxError
impl Sync for CtxError
impl Unpin for CtxError
impl UnsafeUnpin for CtxError
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
Source§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
ToCompactString::to_compact_string() Read moreSource§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
CompactString. Read more