Expand description
§VineError
Defines the specific, structured error types for all operations within the Vine gRPC Inter-Process Communication (IPC) system.
§Error Categories
§Connection Errors
ClientNotConnected: Sidecar not in connection poolConnectionFailed: Unable to establish connectionConnectionLost: Established connection was lost
§RPC Errors
RPCError: Generic gRPC status errorRequestTimeout: Request exceeded configured timeoutRequestCanceled: Request was explicitly canceled
§Serialization Errors
SerializationError: JSON serialization/deserialization failureMessageTooLarge: Message exceeds size limitsInvalidMessageFormat: Message format validation failed
§Transport Errors
TonicTransportError: Low-level tonic transport failureInvalidUri: Invalid URI formatAddressParseError: Invalid socket address format
§Internal Errors
InternalLockError: Mutex poisoned (panic in another thread)InvalidState: Invalid internal state detected
§Error Conversion
The module provides From implementations for seamless conversion from:
serde_json::Error→SerializationErrortonic::transport::Error→TonicTransportErrortonic::Status→RPCErrorInvalidUri→InvalidUriAddrParseError→AddressParseErrorPoisonError<T>→InternalLockError
§Usage Example
# use Vine::Error::VineError;
fn handle_error(error:VineError) {
match error {
VineError::RequestTimeout { SideCarIdentifier, MethodName, TimeoutMilliseconds } => {
eprintln!(
"Request to {} method '{}' timed out after {}ms",
SideCarIdentifier, MethodName, TimeoutMilliseconds
);
// Implement retry logic or fallback behavior
},
VineError::ClientNotConnected(id) => {
eprintln!("Sidecar '{}' not connected, attempting reconnection...", id);
// Attempt to reconnect
},
_ => eprintln!("Vine error: {}", error),
}
}Enums§
- Vine
Error - A comprehensive error enum for the Vine IPC layer.