pub struct LoraError { /* private fields */ }Expand description
Public error type at the lora-database boundary.
Construct via Self::from_anyhow (the typical path — the engine
uses anyhow::Error internally) or via the From impls for any
known concrete error type.
Implementations§
Source§impl LoraError
impl LoraError
pub fn new(code: LoraErrorCode, message: impl Into<String>) -> Self
pub fn with_source( code: LoraErrorCode, message: impl Into<String>, source: impl Error + Send + Sync + 'static, ) -> Self
pub fn code(&self) -> LoraErrorCode
pub fn message(&self) -> &str
pub fn category(&self) -> LoraErrorCategory
Sourcepub fn public_message(&self) -> String
pub fn public_message(&self) -> String
Message intended for external transports. Client-side errors keep
their precise text; server-side failures return a stable, sanitized
sentence while the original details stay available through
Self::message for logs and local debugging.
Sourcepub fn debug_context(&self) -> String
pub fn debug_context(&self) -> String
Detailed cause chain for diagnostics. Do not put this in user-facing response bodies.
Sourcepub fn from_anyhow(err: Error) -> Self
pub fn from_anyhow(err: Error) -> Self
Convert an anyhow::Error from the engine’s internal ?-chains
into a typed LoraError. Best-effort: downcasts the chain to any
known concrete error type and picks the matching code; falls back
to LoraErrorCode::Internal with the original message preserved.
Sourcepub fn from_anyhow_ref(err: &Error) -> Self
pub fn from_anyhow_ref(err: &Error) -> Self
Borrowed version of Self::from_anyhow. Useful in binding
layers that hold &anyhow::Error from a Result::Err capture
and don’t want to move the error.
Trait Implementations§
Source§impl Error for LoraError
impl Error for LoraError
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<DatabaseNameError> for LoraError
impl From<DatabaseNameError> for LoraError
Source§fn from(e: DatabaseNameError) -> Self
fn from(e: DatabaseNameError) -> Self
Source§impl From<ExecutorError> for LoraError
impl From<ExecutorError> for LoraError
Source§fn from(e: ExecutorError) -> Self
fn from(e: ExecutorError) -> Self
Source§impl From<ParseError> for LoraError
impl From<ParseError> for LoraError
Source§fn from(e: ParseError) -> Self
fn from(e: ParseError) -> Self
Source§impl From<PropertyConversionError> for LoraError
impl From<PropertyConversionError> for LoraError
Source§fn from(e: PropertyConversionError) -> Self
fn from(e: PropertyConversionError) -> Self
Source§impl From<SemanticError> for LoraError
impl From<SemanticError> for LoraError
Source§fn from(e: SemanticError) -> Self
fn from(e: SemanticError) -> Self
Source§impl From<SnapshotCodecError> for LoraError
impl From<SnapshotCodecError> for LoraError
Source§fn from(e: SnapshotCodecError) -> Self
fn from(e: SnapshotCodecError) -> Self
Source§impl From<SnapshotError> for LoraError
impl From<SnapshotError> for LoraError
Source§fn from(e: SnapshotError) -> Self
fn from(e: SnapshotError) -> Self
Source§impl From<TransactionError> for LoraError
impl From<TransactionError> for LoraError
Source§fn from(e: TransactionError) -> Self
fn from(e: TransactionError) -> Self
Auto Trait Implementations§
impl !RefUnwindSafe for LoraError
impl !UnwindSafe for LoraError
impl Freeze for LoraError
impl Send for LoraError
impl Sync for LoraError
impl Unpin for LoraError
impl UnsafeUnpin for LoraError
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