pub enum RpcClientError {
BrokerNotFound {
broker_name: String,
},
RequestFailed {
addr: String,
request_code: i32,
timeout_ms: u64,
source: Box<dyn Error + Send + Sync>,
},
UnexpectedResponseCode {
code: i32,
code_name: String,
},
UnsupportedRequestCode {
code: i32,
},
RemoteError(i32, String),
}Expand description
RPC client specific errors with full context preservation
Variants§
BrokerNotFound
Broker address not found in client metadata
RequestFailed
RPC request failed
UnexpectedResponseCode
Unexpected response code received
UnsupportedRequestCode
Request code not supported by the handler
RemoteError(i32, String)
RPC error from remote server
Implementations§
Source§impl RpcClientError
impl RpcClientError
Sourcepub fn broker_not_found(broker_name: impl Into<String>) -> Self
pub fn broker_not_found(broker_name: impl Into<String>) -> Self
Helper to construct a BrokerNotFound error.
Sourcepub fn request_failed<E>(
addr: impl Into<String>,
request_code: i32,
timeout_ms: u64,
source: E,
) -> Self
pub fn request_failed<E>( addr: impl Into<String>, request_code: i32, timeout_ms: u64, source: E, ) -> Self
Helper to construct a RequestFailed error.
Sourcepub fn unexpected_response_code(code: i32, code_name: impl Into<String>) -> Self
pub fn unexpected_response_code(code: i32, code_name: impl Into<String>) -> Self
Helper to construct an UnexpectedResponseCode error.
Sourcepub fn unsupported_request_code(code: i32) -> Self
pub fn unsupported_request_code(code: i32) -> Self
Helper to construct an UnsupportedRequestCode error.
Sourcepub fn remote_error(code: i32, message: impl Into<String>) -> Self
pub fn remote_error(code: i32, message: impl Into<String>) -> Self
Helper to construct a RemoteError.
Trait Implementations§
Source§impl Debug for RpcClientError
impl Debug for RpcClientError
Source§impl Display for RpcClientError
impl Display for RpcClientError
Source§impl Error for RpcClientError
impl Error for RpcClientError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
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
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl From<RpcClientError> for RocketMQError
impl From<RpcClientError> for RocketMQError
Source§fn from(source: RpcClientError) -> Self
fn from(source: RpcClientError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for RpcClientError
impl !RefUnwindSafe for RpcClientError
impl Send for RpcClientError
impl Sync for RpcClientError
impl Unpin for RpcClientError
impl UnsafeUnpin for RpcClientError
impl !UnwindSafe for RpcClientError
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
Mutably borrows from an owned value. Read more