pub struct ClientError(/* private fields */);Expand description
Opaque client boundary error backed by one shared canonical error.
Client operations cross asynchronous callbacks and retry coordinators, so the canonical value is shared rather than copied or flattened into text.
Implementations§
Source§impl ClientError
impl ClientError
Sourcepub fn from_error(error: Error) -> Self
pub fn from_error(error: Error) -> Self
Promotes an owned canonical error into the client boundary.
Retains an already shared canonical error at the client boundary.
Sourcepub fn descriptor(&self) -> &'static ErrorDescriptor
pub fn descriptor(&self) -> &'static ErrorDescriptor
Returns the canonical error descriptor.
Sourcepub fn is(&self, descriptor: &'static ErrorDescriptor) -> bool
pub fn is(&self, descriptor: &'static ErrorDescriptor) -> bool
Returns whether this error has the supplied canonical identity.
Sourcepub fn broker_response_code(&self) -> Option<i32>
pub fn broker_response_code(&self) -> Option<i32>
Returns the retained broker response code when this is a broker failure.
Sourcepub fn broker_addr(&self) -> Option<&str>
pub fn broker_addr(&self) -> Option<&str>
Returns the bounded diagnostic broker address when present.
Borrows the shared canonical error.
Sourcepub fn source_ref<T>(&self) -> Option<&T>where
T: StdError + 'static,
pub fn source_ref<T>(&self) -> Option<&T>where
T: StdError + 'static,
Finds a typed cause anywhere below the canonical client error.
Returns the shared canonical error.
Sourcepub fn into_error(self) -> Error
pub fn into_error(self) -> Error
Returns an owned canonical error while preserving the complete typed source chain when the shared value has other owners.
Sourcepub fn illegal_argument(message: impl Into<String>) -> Self
pub fn illegal_argument(message: impl Into<String>) -> Self
Creates an invalid-argument failure without retaining arbitrary text.
Sourcepub fn illegal_argument_source(
source: impl StdError + Send + Sync + 'static,
) -> Self
pub fn illegal_argument_source( source: impl StdError + Send + Sync + 'static, ) -> Self
Creates an invalid-argument failure with a typed source.
Sourcepub fn not_started() -> Self
pub fn not_started() -> Self
Creates a client-not-started lifecycle failure.
Sourcepub fn already_started() -> Self
pub fn already_started() -> Self
Creates a client-already-started lifecycle failure.
Sourcepub fn shutting_down() -> Self
pub fn shutting_down() -> Self
Creates a client-shutting-down lifecycle failure.
Sourcepub fn invalid_state(expected: impl AsRef<str>, actual: impl AsRef<str>) -> Self
pub fn invalid_state(expected: impl AsRef<str>, actual: impl AsRef<str>) -> Self
Creates an invalid client-state failure.
Creates an unavailable client-component failure.
Sourcepub fn not_initialized(component: impl AsRef<str>) -> Self
pub fn not_initialized(component: impl AsRef<str>) -> Self
Creates a component-not-initialized failure.
Sourcepub fn config_missing(key: impl AsRef<str>) -> Self
pub fn config_missing(key: impl AsRef<str>) -> Self
Creates a configuration-missing failure.
Sourcepub fn config_invalid(
key: impl AsRef<str>,
value: impl AsRef<str>,
reason: impl AsRef<str>,
) -> Self
pub fn config_invalid( key: impl AsRef<str>, value: impl AsRef<str>, reason: impl AsRef<str>, ) -> Self
Creates an invalid-configuration failure.
Sourcepub fn config_invalid_source(
key: impl AsRef<str>,
value_present: bool,
source: impl StdError + Send + Sync + 'static,
) -> Self
pub fn config_invalid_source( key: impl AsRef<str>, value_present: bool, source: impl StdError + Send + Sync + 'static, ) -> Self
Creates an invalid-configuration failure with a typed source.
Sourcepub fn config_parse_failed(
key: impl AsRef<str>,
reason: impl AsRef<str>,
) -> Self
pub fn config_parse_failed( key: impl AsRef<str>, reason: impl AsRef<str>, ) -> Self
Creates a configuration-parse failure.
Sourcepub fn config_parse_source(
key: impl AsRef<str>,
source: impl StdError + Send + Sync + 'static,
) -> Self
pub fn config_parse_source( key: impl AsRef<str>, source: impl StdError + Send + Sync + 'static, ) -> Self
Creates a configuration-parse failure with a typed source.
Sourcepub fn response_process_failed(
operation: impl AsRef<str>,
reason: impl AsRef<str>,
) -> Self
pub fn response_process_failed( operation: impl AsRef<str>, reason: impl AsRef<str>, ) -> Self
Creates a response-processing failure.
Sourcepub fn response_process_source(
operation: impl AsRef<str>,
source: impl StdError + Send + Sync + 'static,
) -> Self
pub fn response_process_source( operation: impl AsRef<str>, source: impl StdError + Send + Sync + 'static, ) -> Self
Creates a response-processing failure with a typed source.
Sourcepub fn timeout(operation: impl AsRef<str>, timeout_ms: u64) -> Self
pub fn timeout(operation: impl AsRef<str>, timeout_ms: u64) -> Self
Creates an operation-timeout failure.
Sourcepub fn internal(
operation: impl AsRef<str>,
source: impl StdError + Send + Sync + 'static,
) -> Self
pub fn internal( operation: impl AsRef<str>, source: impl StdError + Send + Sync + 'static, ) -> Self
Creates an internal failure while retaining its typed source.
Sourcepub fn invariant_violated(invariant: impl AsRef<str>) -> Self
pub fn invariant_violated(invariant: impl AsRef<str>) -> Self
Creates an invariant failure.
Sourcepub fn service_failed(operation: impl AsRef<str>) -> Self
pub fn service_failed(operation: impl AsRef<str>) -> Self
Creates a service lifecycle failure.
Sourcepub fn service_source(
operation: impl AsRef<str>,
source: impl StdError + Send + Sync + 'static,
) -> Self
pub fn service_source( operation: impl AsRef<str>, source: impl StdError + Send + Sync + 'static, ) -> Self
Creates a service lifecycle failure with a typed source.
Sourcepub fn invalid_property(property: impl AsRef<str>) -> Self
pub fn invalid_property(property: impl AsRef<str>) -> Self
Creates an invalid-message-property failure.
Sourcepub fn broker_not_found(broker: impl AsRef<str>) -> Self
pub fn broker_not_found(broker: impl AsRef<str>) -> Self
Creates a broker-lookup failure.
Sourcepub fn broker_operation_failed(
operation: impl AsRef<str>,
code: i32,
message: impl AsRef<str>,
) -> Self
pub fn broker_operation_failed( operation: impl AsRef<str>, code: i32, message: impl AsRef<str>, ) -> Self
Creates a broker-operation failure.
Sourcepub fn broker_operation_failed_at(
operation: impl AsRef<str>,
code: i32,
message: impl AsRef<str>,
broker_addr: Option<impl AsRef<str>>,
) -> Self
pub fn broker_operation_failed_at( operation: impl AsRef<str>, code: i32, message: impl AsRef<str>, broker_addr: Option<impl AsRef<str>>, ) -> Self
Creates a broker-operation failure with an optional broker address.
Sourcepub fn broker_operation_source(
operation: impl AsRef<str>,
code: i32,
broker_addr: Option<impl AsRef<str>>,
source: impl StdError + Send + Sync + 'static,
) -> Self
pub fn broker_operation_source( operation: impl AsRef<str>, code: i32, broker_addr: Option<impl AsRef<str>>, source: impl StdError + Send + Sync + 'static, ) -> Self
Creates a broker-operation failure while retaining its typed source.
Sourcepub fn with_broker_addr(self, broker_addr: impl AsRef<str>) -> Self
pub fn with_broker_addr(self, broker_addr: impl AsRef<str>) -> Self
Adds a broker address to a newly created broker-operation failure.
Sourcepub fn route_not_found(topic: impl AsRef<str>) -> Self
pub fn route_not_found(topic: impl AsRef<str>) -> Self
Creates a route-not-found failure.
Sourcepub fn dns_failed() -> Self
pub fn dns_failed() -> Self
Creates a DNS-resolution failure without exposing endpoint details.
Sourcepub fn dns_failed_source(source: impl StdError + Send + Sync + 'static) -> Self
pub fn dns_failed_source(source: impl StdError + Send + Sync + 'static) -> Self
Creates a DNS-resolution failure while retaining its typed source.
Methods from Deref<Target = Error>§
Sourcepub fn descriptor(&self) -> &'static ErrorDescriptor
pub fn descriptor(&self) -> &'static ErrorDescriptor
Returns the catalog descriptor that owns identity and policy.
Sourcepub fn class(&self) -> ErrorClass
pub fn class(&self) -> ErrorClass
Returns the broad catalog-owned class.
Sourcepub fn condition(&self) -> CanonicalCondition
pub fn condition(&self) -> CanonicalCondition
Returns the protocol-independent canonical condition.
Sourcepub fn fault(&self) -> FaultAttribution
pub fn fault(&self) -> FaultAttribution
Returns the catalog-owned fault attribution.
Sourcepub fn component(&self) -> ComponentId
pub fn component(&self) -> ComponentId
Returns the catalog component that owns this identity.
Sourcepub fn severity(&self) -> ErrorSeverity
pub fn severity(&self) -> ErrorSeverity
Returns the catalog-owned severity.
Sourcepub fn recovery_hint(&self) -> RecoveryHint
pub fn recovery_hint(&self) -> RecoveryHint
Returns the catalog-owned recovery hint.
Sourcepub fn backtrace_policy(&self) -> BacktracePolicy
pub fn backtrace_policy(&self) -> BacktracePolicy
Returns the catalog-controlled backtrace policy.
Sourcepub fn projection(&self) -> ProjectionSpec
pub fn projection(&self) -> ProjectionSpec
Returns descriptor-owned boundary projections.
Sourcepub fn context(&self) -> &ErrorContext
pub fn context(&self) -> &ErrorContext
Returns the typed context retained by this error.
Sourcepub fn public_view(&self) -> Result<PublicErrorView<'_>, ViewContextViolation>
pub fn public_view(&self) -> Result<PublicErrorView<'_>, ViewContextViolation>
Creates a descriptor-validated public projection.
§Errors
Returns an error when the retained context does not match the selected catalog descriptor.
Sourcepub fn diagnostic_view(
&self,
) -> Result<DiagnosticView<'_>, ViewContextViolation>
pub fn diagnostic_view( &self, ) -> Result<DiagnosticView<'_>, ViewContextViolation>
Creates a descriptor-validated diagnostic projection.
The view never includes the source, caller location, or backtrace.
§Errors
Returns an error when the retained context does not match the selected catalog descriptor.
Trait Implementations§
Source§impl AsRef<Error> for ClientError
impl AsRef<Error> for ClientError
Source§impl Clone for ClientError
impl Clone for ClientError
Source§impl Debug for ClientError
impl Debug for ClientError
Source§impl Deref for ClientError
impl Deref for ClientError
Source§impl Display for ClientError
impl Display for ClientError
Source§impl Error for ClientError
impl Error for ClientError
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()
Source§impl From<Arc<Error>> for ClientError
impl From<Arc<Error>> for ClientError
Source§fn from(error: SharedError) -> Self
fn from(error: SharedError) -> Self
Source§impl From<ClientError> for SharedError
impl From<ClientError> for SharedError
Source§fn from(error: ClientError) -> Self
fn from(error: ClientError) -> Self
Source§impl From<Error> for ClientError
impl From<Error> for ClientError
Source§impl From<MQBrokerException> for ClientError
impl From<MQBrokerException> for ClientError
Source§fn from(exception: MQBrokerException) -> Self
fn from(exception: MQBrokerException) -> Self
Source§impl From<MQClientException> for ClientError
impl From<MQClientException> for ClientError
Source§fn from(exception: MQClientException) -> Self
fn from(exception: MQClientException) -> Self
Source§impl From<OffsetNotFoundException> for ClientError
impl From<OffsetNotFoundException> for ClientError
Source§fn from(exception: OffsetNotFoundException) -> Self
fn from(exception: OffsetNotFoundException) -> Self
Source§impl From<RequestTimeoutException> for ClientError
impl From<RequestTimeoutException> for ClientError
Source§fn from(_exception: RequestTimeoutException) -> Self
fn from(_exception: RequestTimeoutException) -> Self
Auto Trait Implementations§
impl !RefUnwindSafe for ClientError
impl !UnwindSafe for ClientError
impl Freeze for ClientError
impl Send for ClientError
impl Sync for ClientError
impl Unpin for ClientError
impl UnsafeUnpin for ClientError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FmtForward for T
impl<T> FmtForward for T
Source§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self to use its Binary implementation when Debug-formatted.Source§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self to use its Display implementation when
Debug-formatted.Source§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self to use its LowerExp implementation when
Debug-formatted.Source§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self to use its LowerHex implementation when
Debug-formatted.Source§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self to use its Octal implementation when Debug-formatted.Source§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self to use its Pointer implementation when
Debug-formatted.Source§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self to use its UpperExp implementation when
Debug-formatted.Source§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self to use its UpperHex implementation when
Debug-formatted.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
Source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
Source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
Source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self, then passes self.as_ref() into the pipe function.Source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.Source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> Tap for T
impl<T> Tap for T
Source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read moreSource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read moreSource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read moreSource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read moreSource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.Source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.Source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.Source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.Source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.