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
impl SoapError
Sourcepub fn new(kind: SoapErrorKind, message: impl Into<String>) -> Self
pub fn new(kind: SoapErrorKind, message: impl Into<String>) -> Self
Creates an error with the category’s default transience.
Sourcepub fn validation(message: impl Into<String>) -> Self
pub fn validation(message: impl Into<String>) -> Self
Creates an input or domain validation error.
Sourcepub fn conflict(message: impl Into<String>) -> Self
pub fn conflict(message: impl Into<String>) -> Self
Creates an error for an operation that conflicts with current state.
Creates an authentication error.
Sourcepub fn unsupported(message: impl Into<String>) -> Self
pub fn unsupported(message: impl Into<String>) -> Self
Creates an unsupported-capability error.
Creates a transient dependency-unavailable error.
Sourcepub fn infrastructure(message: impl Into<String>) -> Self
pub fn infrastructure(message: impl Into<String>) -> Self
Creates an unclassified infrastructure error.
Sourcepub fn with_source<E>(self, source: E) -> Self
pub fn with_source<E>(self, source: E) -> Self
Attaches the original technical cause to this error.
Sourcepub const fn with_transience(self, transience: ErrorTransience) -> Self
pub const fn with_transience(self, transience: ErrorTransience) -> Self
Overrides the adapter’s classification of the failure condition.
Sourcepub fn with_diagnostic_id(self, diagnostic_id: impl Into<DiagnosticId>) -> Self
pub fn with_diagnostic_id(self, diagnostic_id: impl Into<DiagnosticId>) -> Self
Attaches an identifier generated by an application boundary.
Sourcepub const fn kind(&self) -> SoapErrorKind
pub const fn kind(&self) -> SoapErrorKind
Returns the stable error category.
Sourcepub const fn transience(&self) -> ErrorTransience
pub const fn transience(&self) -> ErrorTransience
Returns the failure-condition classification.
Sourcepub fn diagnostic_id(&self) -> Option<&DiagnosticId>
pub fn diagnostic_id(&self) -> Option<&DiagnosticId>
Returns the optional diagnostics correlation identifier.
Sourcepub const fn is_transient(&self) -> bool
pub const fn is_transient(&self) -> bool
Indicates whether the underlying failure condition may be short-lived.
Sourcepub const fn is_reportable(&self) -> bool
pub const fn is_reportable(&self) -> bool
Indicates whether the error should normally be reported to monitoring.
Trait Implementations§
Source§impl Error for SoapError
impl Error for SoapError
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()