pub struct SaddleError { /* private fields */ }Expand description
An error safe to propagate across Saddle component boundaries.
message must not contain credentials, SQL parameters, request payloads or
other sensitive implementation details.
Implementations§
Source§impl SaddleError
impl SaddleError
pub fn new( kind: ErrorKind, code: &'static str, message: impl Into<String>, ) -> Self
pub const fn kind(&self) -> ErrorKind
pub const fn code(&self) -> &'static str
pub fn message(&self) -> &str
pub fn with_diagnostic(self, diagnostic: Diagnostic) -> Self
pub fn diagnostic(&self) -> Option<&Diagnostic>
Sourcepub fn with_source_receipt<T: Any + Send + Sync>(self, receipt: T) -> Self
pub fn with_source_receipt<T: Any + Send + Sync>(self, receipt: T) -> Self
Carry the writer’s concrete receipt across a component boundary. This slot alone does not claim that the original source was written.
pub fn source_receipt<T: Any + Send + Sync>(&self) -> Option<&T>
Sourcepub fn with_unconfirmed_original(
self,
original: Box<dyn Error + Send + Sync>,
) -> Self
pub fn with_unconfirmed_original( self, original: Box<dyn Error + Send + Sync>, ) -> Self
Retain an original whose controlled write was not confirmed. This is negative evidence and cannot be consumed as a source receipt.
pub fn unconfirmed_original(&self) -> Option<&(dyn Error + Send + Sync)>
pub fn take_unconfirmed_original( &mut self, ) -> Option<Box<dyn Error + Send + Sync>>
Sourcepub fn with_cleanup_source_record<T: Any + Send + Sync>(
self,
diagnostic: Diagnostic,
receipt: T,
) -> Self
pub fn with_cleanup_source_record<T: Any + Send + Sync>( self, diagnostic: Diagnostic, receipt: T, ) -> Self
Keep an independent cleanup occurrence alongside the unchanged primary. Only the concrete writer receipt can establish that its original was written.
pub fn cleanup_diagnostic(&self) -> Option<&Diagnostic>
pub fn cleanup_source_receipt<T: Any + Send + Sync>(&self) -> Option<&T>
Sourcepub fn with_unconfirmed_cleanup_diagnostic(self, diagnostic: Diagnostic) -> Self
pub fn with_unconfirmed_cleanup_diagnostic(self, diagnostic: Diagnostic) -> Self
Retain the independent cleanup occurrence when its original write was unavailable. No receipt is attached to this negative fact.
Sourcepub fn with_unconfirmed_source(self) -> Self
pub fn with_unconfirmed_source(self) -> Self
The primary error’s original source record could not be confirmed.
Sourcepub fn with_unconfirmed_cleanup_source(self) -> Self
pub fn with_unconfirmed_cleanup_source(self) -> Self
A separate cleanup failure could not obtain a written source record. This negative fact never claims the primary or cleanup was recorded.
Sourcepub fn during_cleanup_of(self, primary: &Self) -> Self
pub fn during_cleanup_of(self, primary: &Self) -> Self
Preserve this cleanup occurrence and link it to the independent primary.
Sourcepub fn during_cleanup_of_occurrence(
self,
primary: &DiagnosticOccurrence,
) -> Self
pub fn during_cleanup_of_occurrence( self, primary: &DiagnosticOccurrence, ) -> Self
Link a later cleanup failure to a captured primary occurrence.
Sourcepub fn wrap_diagnostic(self, cause: DiagnosticCause) -> Self
pub fn wrap_diagnostic(self, cause: DiagnosticCause) -> Self
Propagate existing diagnosis without changing its origin or error semantics. An uninstrumented upstream error remains uninstrumented, never fabricated.
Trait Implementations§
Source§impl Debug for SaddleError
impl Debug for SaddleError
Source§impl Display for SaddleError
impl Display for SaddleError
Source§impl Error for SaddleError
impl Error for SaddleError
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()