pub enum RuntimeError {
Show 16 variants
Unavailable {
message: String,
target: Option<ActrId>,
},
DeadlineExceeded {
message: String,
timeout_ms: u64,
},
NotFound {
actor_id: ActrId,
message: String,
},
InvalidArgument(String),
FailedPrecondition(String),
PermissionDenied(String),
DecodeFailure {
message: String,
raw_bytes: Option<Vec<u8>>,
},
Internal {
message: String,
panic_info: Option<String>,
},
MailboxError(String),
ConfigurationError(String),
InitializationError(String),
ShutdownError(String),
IoError(Error),
JsonError(Error),
ProtocolError(ProtocolError),
Other(Error),
}Expand description
Runtime error types following gRPC-style classification
§Error Classification
- Transient: Temporary failures, safe to retry (UNAVAILABLE, DEADLINE_EXCEEDED)
- Permanent: Require system state fix, do NOT retry (NOT_FOUND, INVALID_ARGUMENT)
- Poison: Corrupted messages requiring manual intervention (decode failures)
§Design Philosophy
Unlike classic Actor systems (Erlang/Akka) that use Supervision trees, Actor-RTC treats each Actr as a microservice unit:
- Caller controls retry logic (not framework)
- Explicit error propagation (not transparent restart)
- Dead Letter Queue for poison messages
Variants§
Service temporarily unavailable (gRPC UNAVAILABLE)
Transient: Connection lost, peer overloaded, temporary resource exhaustion Caller should: Retry with exponential backoff
DeadlineExceeded
Request timeout exceeded (gRPC DEADLINE_EXCEEDED)
Transient: Network delay, peer slow response Caller should: Retry with longer timeout or give up
NotFound
Target Actor not found (gRPC NOT_FOUND)
Permanent: Actor not registered in signaling server Caller should: NOT retry, perform service discovery first
InvalidArgument(String)
Invalid argument provided (gRPC INVALID_ARGUMENT)
Permanent: Malformed request, validation failure Caller should: NOT retry, fix the request
FailedPrecondition(String)
Precondition not met (gRPC FAILED_PRECONDITION)
Permanent: System state incompatible with operation Caller should: NOT retry, fix system state first
PermissionDenied(String)
Permission denied (gRPC PERMISSION_DENIED)
Permanent: ACL check failed Caller should: NOT retry, check authorization
DecodeFailure
Protobuf decode failure
Poison: Corrupted message, cannot be processed Framework: Move to Dead Letter Queue, log raw bytes
Internal
Internal framework error (gRPC INTERNAL)
Severity: High - indicates framework bug or panic Framework: Log stack trace, capture panic info
MailboxError(String)
Mailbox operation error
Severity: Critical - SQLite database issue Framework: Trigger alert, may need manual intervention
ConfigurationError(String)
Configuration error
InitializationError(String)
Initialization error
ShutdownError(String)
Shutdown error
IoError(Error)
IO Error
JsonError(Error)
JSON Error
ProtocolError(ProtocolError)
Protocol Error
Other(Error)
Other error
Implementations§
Source§impl RuntimeError
impl RuntimeError
Sourcepub fn classification(&self) -> ErrorClassification
pub fn classification(&self) -> ErrorClassification
Error classification for retry decision
Follows gRPC status code semantics:
- Transient: Safe to retry (UNAVAILABLE, DEADLINE_EXCEEDED)
- Permanent: Do NOT retry (NOT_FOUND, INVALID_ARGUMENT, etc.)
- Poison: Needs manual intervention (DecodeFailure)
Sourcepub fn is_retryable(&self) -> bool
pub fn is_retryable(&self) -> bool
Check if error is retryable (Transient classification)
Caller should use exponential backoff for retry.
Sourcepub fn requires_dlq(&self) -> bool
pub fn requires_dlq(&self) -> bool
Check if error requires Dead Letter Queue
Poison messages cannot be processed and need manual intervention.
Sourcepub fn status_code(&self) -> &'static str
pub fn status_code(&self) -> &'static str
Get gRPC-style status code name
For logging and metrics (compatible with gRPC status codes).
Sourcepub fn severity(&self) -> u8
pub fn severity(&self) -> u8
Get error severity (1-10, 10 is most critical)
Used for alerting thresholds and monitoring.
Sourcepub fn requires_system_shutdown(&self) -> bool
pub fn requires_system_shutdown(&self) -> bool
Check if error requires system shutdown
Only fatal configuration/initialization errors should shutdown.
Trait Implementations§
Source§impl Debug for RuntimeError
impl Debug for RuntimeError
Source§impl Display for RuntimeError
impl Display for RuntimeError
Source§impl Error for RuntimeError
impl Error for RuntimeError
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<Error> for RuntimeError
impl From<Error> for RuntimeError
Source§impl From<Error> for RuntimeError
impl From<Error> for RuntimeError
Source§impl From<Error> for RuntimeError
impl From<Error> for RuntimeError
Source§impl From<NetworkError> for RuntimeError
impl From<NetworkError> for RuntimeError
Source§fn from(err: NetworkError) -> Self
fn from(err: NetworkError) -> Self
Source§impl From<ProtocolError> for RuntimeError
impl From<ProtocolError> for RuntimeError
Source§fn from(source: ProtocolError) -> Self
fn from(source: ProtocolError) -> Self
Auto Trait Implementations§
impl Freeze for RuntimeError
impl !RefUnwindSafe for RuntimeError
impl Send for RuntimeError
impl Sync for RuntimeError
impl Unpin for RuntimeError
impl !UnwindSafe for RuntimeError
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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> 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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more