pub struct StoreError { /* private fields */ }Expand description
Canonical storage failure shared by the capability and implementation layers.
Stable identity and policy come exclusively from the catalog descriptor. Operation and component are typed diagnostic context. Private detail and a typed source are retained for local diagnosis, but their values are never formatted by this facade or exposed through its public view.
Implementations§
Source§impl StoreError
impl StoreError
Sourcepub fn new(
descriptor: &'static ErrorDescriptor,
operation: StoreOperation,
) -> Self
pub fn new( descriptor: &'static ErrorDescriptor, operation: StoreOperation, ) -> Self
Creates a storage error with catalog-owned identity.
Callers select one of the twelve STORAGE_* descriptors exported by
rocketmq-error; runtime detail must never select or override identity.
§Panics
Panics when descriptor is not one of the twelve canonical storage
descriptors. This is a programmer contract: runtime failures select a
reviewed storage identity before constructing the facade.
Sourcepub fn try_new(
descriptor: &'static ErrorDescriptor,
operation: StoreOperation,
) -> Option<Self>
pub fn try_new( descriptor: &'static ErrorDescriptor, operation: StoreOperation, ) -> Option<Self>
Attempts to create a storage error with a validated catalog identity.
Returns None when descriptor belongs to another error domain. The
facade never accepts caller-provided context, so successful construction
also guarantees that only the four storage context fields can be emitted.
Sourcepub fn in_component(self, component: StoreComponent) -> Self
pub fn in_component(self, component: StoreComponent) -> Self
Adds the closed component classification as diagnostic context.
Sourcepub fn with_detail(self, detail: impl Into<String>) -> Self
pub fn with_detail(self, detail: impl Into<String>) -> Self
Retains sensitive diagnostic detail without exposing its value.
Sourcepub fn with_source(self, source: impl StdError + Send + Sync + 'static) -> Self
pub fn with_source(self, source: impl StdError + Send + Sync + 'static) -> Self
Preserves a typed cause in the standard source chain.
Sourcepub fn with_boxed_source(self, source: Box<dyn StdError + Send + Sync>) -> Self
pub fn with_boxed_source(self, source: Box<dyn StdError + Send + Sync>) -> Self
Preserves an already boxed typed cause in the standard source chain.
Sourcepub const fn descriptor(&self) -> &'static ErrorDescriptor
pub const fn descriptor(&self) -> &'static ErrorDescriptor
Returns the immutable catalog descriptor that owns this error’s identity.
Sourcepub const fn condition(&self) -> CanonicalCondition
pub const fn condition(&self) -> CanonicalCondition
Returns the protocol-independent condition.
Sourcepub const fn severity(&self) -> ErrorSeverity
pub const fn severity(&self) -> ErrorSeverity
Returns the catalog-owned severity.
Sourcepub const fn recovery_hint(&self) -> RecoveryHint
pub const fn recovery_hint(&self) -> RecoveryHint
Returns the catalog-owned recovery hint.
Sourcepub const fn operation(&self) -> StoreOperation
pub const fn operation(&self) -> StoreOperation
Returns the operation that failed.
Sourcepub const fn component(&self) -> StoreComponent
pub const fn component(&self) -> StoreComponent
Returns the component that failed.
Sourcepub const fn context(&self) -> &ErrorContext
pub const fn context(&self) -> &ErrorContext
Returns the bounded context retained by the canonical error.
Sourcepub const fn location(&self) -> &'static Location<'static>
pub const fn location(&self) -> &'static Location<'static>
Returns the first-promotion caller location.
Sourcepub const fn backtrace(&self) -> Option<&Backtrace>
pub const 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 the descriptor-validated public projection.
§Errors
Returns a schema violation if the catalog and the internally generated storage context become inconsistent.
Sourcepub fn diagnostic_view(
&self,
) -> Result<DiagnosticView<'_>, ViewContextViolation>
pub fn diagnostic_view( &self, ) -> Result<DiagnosticView<'_>, ViewContextViolation>
Creates the descriptor-validated controlled diagnostic projection.
§Errors
Returns a schema violation if the catalog and the internally generated storage context become inconsistent.
Trait Implementations§
Source§impl Debug for StoreError
impl Debug for StoreError
Source§impl Display for StoreError
impl Display for StoreError
Source§impl Error for StoreError
impl Error for StoreError
Source§fn source(&self) -> Option<&(dyn StdError + 'static)>
fn source(&self) -> Option<&(dyn StdError + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()