Skip to main content

SoapError

Struct SoapError 

Source
pub struct SoapError { /* private fields */ }
Expand description

Stable application error with optional technical diagnostics.

message is safe application-facing context. Infrastructure details stay in the standard Error::source chain and must not be exposed directly in transport responses.

Implementations§

Source§

impl SoapError

Source

pub fn new(kind: SoapErrorKind, message: impl Into<String>) -> Self

Creates an error with the category’s default transience.

Source

pub fn not_found(message: impl Into<String>) -> Self

Creates a missing-resource error.

Source

pub fn validation(message: impl Into<String>) -> Self

Creates an input or domain validation error.

Source

pub fn conflict(message: impl Into<String>) -> Self

Creates an error for an operation that conflicts with current state.

Source

pub fn unauthorized() -> Self

Creates an authentication error.

Source

pub fn forbidden() -> Self

Creates an authorization error.

Source

pub fn domain(message: impl Into<String>) -> Self

Creates a domain-operation error.

Source

pub fn unsupported(message: impl Into<String>) -> Self

Creates an unsupported-capability error.

Source

pub fn timeout(message: impl Into<String>) -> Self

Creates a transient timeout error.

Source

pub fn unavailable(message: impl Into<String>) -> Self

Creates a transient dependency-unavailable error.

Source

pub fn infrastructure(message: impl Into<String>) -> Self

Creates an unclassified infrastructure error.

Source

pub fn with_source<E>(self, source: E) -> Self
where E: Error + Send + Sync + 'static,

Attaches the original technical cause to this error.

Source

pub const fn with_transience(self, transience: ErrorTransience) -> Self

Overrides the adapter’s classification of the failure condition.

Source

pub fn with_diagnostic_id(self, diagnostic_id: impl Into<DiagnosticId>) -> Self

Attaches an identifier generated by an application boundary.

Source

pub const fn kind(&self) -> SoapErrorKind

Returns the stable error category.

Source

pub fn message(&self) -> &str

Returns safe application-facing context.

Source

pub const fn transience(&self) -> ErrorTransience

Returns the failure-condition classification.

Source

pub fn diagnostic_id(&self) -> Option<&DiagnosticId>

Returns the optional diagnostics correlation identifier.

Source

pub const fn is_transient(&self) -> bool

Indicates whether the underlying failure condition may be short-lived.

Source

pub const fn is_reportable(&self) -> bool

Indicates whether the error should normally be reported to monitoring.

Trait Implementations§

Source§

impl Debug for SoapError

Source§

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

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

impl Display for SoapError

Source§

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

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

impl Error for SoapError

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> 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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.