Skip to main content

SaddleError

Struct SaddleError 

Source
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

Source

pub fn new( kind: ErrorKind, code: &'static str, message: impl Into<String>, ) -> Self

Source

pub const fn kind(&self) -> ErrorKind

Source

pub const fn code(&self) -> &'static str

Source

pub fn message(&self) -> &str

Source

pub fn with_diagnostic(self, diagnostic: Diagnostic) -> Self

Source

pub fn diagnostic(&self) -> Option<&Diagnostic>

Source

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.

Source

pub fn source_receipt<T: Any + Send + Sync>(&self) -> Option<&T>

Source

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.

Source

pub fn unconfirmed_original(&self) -> Option<&(dyn Error + Send + Sync)>

Source

pub fn take_unconfirmed_original( &mut self, ) -> Option<Box<dyn Error + Send + Sync>>

Source

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.

Source

pub fn cleanup_diagnostic(&self) -> Option<&Diagnostic>

Source

pub fn cleanup_source_receipt<T: Any + Send + Sync>(&self) -> Option<&T>

Source

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.

Source

pub fn with_unconfirmed_source(self) -> Self

The primary error’s original source record could not be confirmed.

Source

pub const fn source_unavailable(&self) -> bool

Source

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.

Source

pub const fn cleanup_source_unavailable(&self) -> bool

Source

pub fn during_cleanup_of(self, primary: &Self) -> Self

Preserve this cleanup occurrence and link it to the independent primary.

Source

pub fn during_cleanup_of_occurrence( self, primary: &DiagnosticOccurrence, ) -> Self

Link a later cleanup failure to a captured primary occurrence.

Source

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

Source§

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

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

impl Display for SaddleError

Source§

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

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

impl Error for SaddleError

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

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> Same for T

Source§

type Output = T

Should always be Self
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 = !

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

fn try_from(value: U) -> Result<T, !>

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.