pub enum VineError {
Show 14 variants
ClientNotConnected(String),
ConnectionFailed {
SideCarIdentifier: String,
Address: String,
Reason: String,
},
ConnectionLost(String),
RPCError(String),
RequestTimeout {
SideCarIdentifier: String,
MethodName: String,
TimeoutMilliseconds: u64,
},
RequestCanceled {
SideCarIdentifier: String,
MethodName: String,
},
SerializationError(Error),
MessageTooLarge {
ActualSize: usize,
MaxSize: usize,
},
InvalidMessageFormat(String),
TonicTransportError(Error),
InternalLockError(String),
InvalidState(String),
InvalidUri(InvalidUri),
AddressParseError(AddrParseError),
}Expand description
A comprehensive error enum for the Vine IPC layer.
Each variant provides detailed context about the failure, enabling precise error handling and recovery strategies.
Variants§
ClientNotConnected(String)
A gRPC client channel for the specified sidecar could not be found or is not ready in the connection pool.
This typically occurs when trying to send a request to a sidecar that was never connected or has been disconnected.
ConnectionFailed
Failed to establish a connection to the specified sidecar.
This indicates that connection attempts failed, possibly due to network issues, incorrect address, or the sidecar being unavailable.
ConnectionLost(String)
An established connection to the sidecar was lost.
This occurs when an active connection fails during communication.
RPCError(String)
An RPC call to a sidecar failed with a specific gRPC status.
This wraps tonic::Status errors with more context about what went wrong.
RequestTimeout
A request did not receive a response within the specified timeout.
Includes the sidecar identifier, method name, and timeout duration for debugging and retry logic.
RequestCanceled
A request was explicitly canceled before completion.
SerializationError(Error)
An error occurred while serializing or deserializing a JSON payload.
This is automatically converted from serde_json::Error when using the ? operator.
MessageTooLarge
Message exceeded maximum allowed size.
This prevents denial-of-service attacks via oversized messages.
InvalidMessageFormat(String)
Message format validation failed.
This occurs when a message doesn’t conform to expected structure.
TonicTransportError(Error)
A low-level error occurred in the tonic gRPC transport layer.
This is automatically converted from tonic::transport::Error.
InternalLockError(String)
A shared state mutex was "poisoned," indicating a panic.
This is a critical error indicating that a thread panicked while holding a lock, leaving the shared state in an inconsistent state.
InvalidState(String)
Invalid internal state detected.
This occurs when the system is in an unexpected state that should never happen during normal operation.
InvalidUri(InvalidUri)
An error occurred from an invalid URI.
This is automatically converted from http::uri::InvalidUri.
AddressParseError(AddrParseError)
An error occurred while parsing a socket address.
This is automatically converted from std::net::AddrParseError.
Implementations§
Source§impl VineError
impl VineError
Sourcepub fn IsRecoverable(&self) -> bool
pub fn IsRecoverable(&self) -> bool
Checks if this error is recoverable (can retry the operation).
Recoverable errors include timeouts, connection issues, and temporary failures. Non-recoverable errors include serialization errors and invalid state.
Sourcepub fn ToTonicStatus(&self) -> Status
pub fn ToTonicStatus(&self) -> Status
Converts the error to a tonic::Status for gRPC error responses.
This maps VineError variants to appropriate gRPC status codes:
- RequestTimeout → DeadlineExceeded
- ClientNotConnected → Unavailable
- SerializationError → Internal
- etc.
Trait Implementations§
Source§impl Error for VineError
impl Error for VineError
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
Source§impl From<AddrParseError> for VineError
impl From<AddrParseError> for VineError
Source§fn from(source: AddrParseError) -> Self
fn from(source: AddrParseError) -> Self
Source§impl<T> From<PoisonError<MutexGuard<'_, T>>> for VineError
impl<T> From<PoisonError<MutexGuard<'_, T>>> for VineError
Source§fn from(Error: PoisonError<MutexGuard<'_, T>>) -> Self
fn from(Error: PoisonError<MutexGuard<'_, T>>) -> Self
Auto Trait Implementations§
impl Freeze for VineError
impl !RefUnwindSafe for VineError
impl Send for VineError
impl Sync for VineError
impl Unpin for VineError
impl !UnwindSafe for VineError
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
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Layered].§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.