pub enum Error {
InvalidInput(String),
OperationFailed {
operation: String,
cause: String,
},
ContentBlocked {
reason: String,
},
NotImplemented(String),
FeatureNotEnabled(String),
Unauthorized(String),
}Expand description
Error type for subcog operations.
Uses thiserror for automatic Display and Error trait implementations.
§Error Variant Triggers
| Variant | Raised When |
|---|---|
InvalidInput | Missing required parameters, malformed JSON, invalid namespace names |
OperationFailed | I/O errors, git operations fail, database queries fail |
ContentBlocked | Secret patterns detected (API keys, tokens), PII detected |
NotImplemented | Calling unfinished features (e.g., PostgreSQL consolidation) |
FeatureNotEnabled | Using features requiring compile-time flags |
Unauthorized | Invalid/missing JWT token in MCP HTTP transport |
Variants§
InvalidInput(String)
Invalid input was provided.
Raised when:
- Required parameters are missing (e.g., empty content in capture)
- JSON deserialization fails in MCP tool handlers
- Invalid namespace string is provided
- Prompt template has invalid variable syntax
- Search query is empty or malformed
OperationFailed
An operation failed.
Raised when:
SQLitedatabase operations fail- Filesystem I/O errors occur
- Index backend is not configured
- Service container initialization fails
ContentBlocked
Content was blocked due to security concerns.
Raised when:
- Secret detection finds API keys, tokens, or credentials
- PII patterns are detected (configurable)
- Content fails security policy checks
See security::secrets for pattern definitions.
NotImplemented(String)
Feature not yet implemented.
Raised when:
- PostgreSQL consolidation is called
- Redis consolidation is called
- Other stub implementations are invoked
FeatureNotEnabled(String)
Feature not enabled (requires feature flag).
Raised when:
- Optional Cargo features are not compiled in
- Currently unused but reserved for future gated features
Authentication failed (SEC-H1).
Raised when:
- JWT token is missing in HTTP transport requests
- JWT token is expired or invalid
- JWT signature verification fails
- Insufficient entropy in JWT secret
Trait Implementations§
Source§impl Error for Error
impl Error for Error
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
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
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Auto Trait Implementations§
impl Freeze for Error
impl RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnwindSafe for Error
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
Mutably borrows from an owned value. Read more
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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>
Converts
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>
Converts
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§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Applies the layer to a service and wraps it in [
Layered].§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
Fallible version of [
ToCompactString::to_compact_string()] Read more§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
Converts the given value to a [
CompactString]. Read more§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.