pub struct RuntimeError { /* private fields */ }Expand description
Stable, catalog-backed operational runtime failure.
The facade exposes descriptor identity, a matchable RuntimeErrorKind,
closed operation/component labels, a bounded context and an optional
typed source. It intentionally does not expose implementation variants.
Implementations§
Source§impl RuntimeError
impl RuntimeError
Sourcepub fn descriptor(&self) -> &'static ErrorDescriptor
pub fn descriptor(&self) -> &'static ErrorDescriptor
Returns the catalog descriptor.
Sourcepub fn condition(&self) -> CanonicalCondition
pub fn condition(&self) -> CanonicalCondition
Returns the descriptor-owned canonical condition.
Sourcepub fn recovery_hint(&self) -> RecoveryHint
pub fn recovery_hint(&self) -> RecoveryHint
Returns the descriptor-owned recovery hint.
Sourcepub const fn kind(&self) -> RuntimeErrorKind
pub const fn kind(&self) -> RuntimeErrorKind
Returns why the operation failed.
Sourcepub const fn operation(&self) -> RuntimeOperation
pub const fn operation(&self) -> RuntimeOperation
Returns the closed operation label.
Sourcepub fn context(&self) -> &ErrorContext
pub fn context(&self) -> &ErrorContext
Returns bounded descriptor context.
Sourcepub fn location(&self) -> &'static Location<'static>
pub fn location(&self) -> &'static Location<'static>
Returns the first-promotion caller location.
Sourcepub fn backtrace(&self) -> Option<&Backtrace>
pub fn backtrace(&self) -> Option<&Backtrace>
Returns the catalog-controlled captured backtrace, when enabled.
Sourcepub fn public_view(&self) -> Result<PublicErrorView<'_>, ViewContextViolation>
pub fn public_view(&self) -> Result<PublicErrorView<'_>, ViewContextViolation>
Creates a safe public projection when the context matches the descriptor.
§Errors
Returns an error only if an internal descriptor/context invariant has been violated.
Sourcepub fn diagnostic_view(
&self,
) -> Result<DiagnosticView<'_>, ViewContextViolation>
pub fn diagnostic_view( &self, ) -> Result<DiagnosticView<'_>, ViewContextViolation>
Creates a controlled diagnostic projection when the context matches the descriptor.
§Errors
Returns an error only if an internal descriptor/context invariant has been violated.
Sourcepub fn configuration(operation: RuntimeOperation) -> Self
pub fn configuration(operation: RuntimeOperation) -> Self
Creates an external configuration failure.
Sourcepub fn configuration_failure(
operation: RuntimeOperation,
source: impl Error + Send + Sync + 'static,
) -> Self
pub fn configuration_failure( operation: RuntimeOperation, source: impl Error + Send + Sync + 'static, ) -> Self
Creates a configuration-loading failure while retaining its typed source.
Sourcepub fn build(operation: RuntimeOperation, source: Error) -> Self
pub fn build(operation: RuntimeOperation, source: Error) -> Self
Creates a runtime-build failure while retaining the build source.
Sourcepub fn io(operation: RuntimeOperation, source: Error) -> Self
pub fn io(operation: RuntimeOperation, source: Error) -> Self
Creates an I/O failure while retaining the I/O source.
Creates a runtime-context-unavailable failure.
Sourcepub fn closed(operation: RuntimeOperation) -> Self
pub fn closed(operation: RuntimeOperation) -> Self
Creates a failure for an owner, operation or worker that no longer admits work.
It shares the runtime.context.unavailable descriptor with
Self::context_unavailable; Self::kind reports
RuntimeErrorKind::Closed.
Sourcepub fn capacity(operation: RuntimeOperation) -> Self
pub fn capacity(operation: RuntimeOperation) -> Self
Creates an operational capacity-exhausted failure.
Sourcepub fn timed_out(operation: RuntimeOperation) -> Self
pub fn timed_out(operation: RuntimeOperation) -> Self
Creates an operation timeout failure.
Sourcepub fn unsupported(operation: RuntimeOperation) -> Self
pub fn unsupported(operation: RuntimeOperation) -> Self
Creates an unsupported-operation failure.
Sourcepub fn join(operation: RuntimeOperation, source: JoinError) -> Self
pub fn join(operation: RuntimeOperation, source: JoinError) -> Self
Creates a task join failure while retaining the join source.
Sourcepub fn internal(
operation: RuntimeOperation,
source: impl Error + Send + Sync + 'static,
) -> Self
pub fn internal( operation: RuntimeOperation, source: impl Error + Send + Sync + 'static, ) -> Self
Creates an internal runtime failure while retaining a typed source.
Sourcepub fn internal_failure(operation: RuntimeOperation) -> Self
pub fn internal_failure(operation: RuntimeOperation) -> Self
Creates a source-free internal runtime failure.
Trait Implementations§
Source§impl Clone for RuntimeError
impl Clone for RuntimeError
Source§impl Debug for RuntimeError
impl Debug for RuntimeError
Source§impl Display for RuntimeError
impl Display for RuntimeError
Source§impl Error for RuntimeError
impl Error for RuntimeError
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()