pub enum ServiceError {
PreStartFailed(Arc<Error>),
OnStartFailed(Arc<Error>),
RunFailed(Arc<Error>),
OnStopFailed(Arc<Error>),
ShutdownDeadlineExceeded {
deadline: Duration,
pending: usize,
},
AlreadyRunning,
AlreadyStopped,
}Expand description
All failure modes of a running Service.
Variants§
PreStartFailed(Arc<Error>)
The node’s pre_start hook returned an error.
No other lifecycle hooks are invoked after this — typical causes are store open failures or journal replay errors.
OnStartFailed(Arc<Error>)
The node’s on_start hook returned an error.
post_stop is still invoked so resources opened in pre_start
have a chance to close.
RunFailed(Arc<Error>)
The node’s run hook returned an error.
on_stop + post_stop are still invoked. The exit status’s
reason is ExitReason::RunError.
OnStopFailed(Arc<Error>)
The node’s on_stop OR post_stop hook returned an error.
Reported after run has returned; usually indicates a flush /
close failure.
ShutdownDeadlineExceeded
One or more tracked tasks did not exit within the shutdown deadline.
The service aborts the laggards; this error is reported so operators can see that shutdown was not fully graceful.
Fields
AlreadyRunning
start() was called on a Service that has already run.
A Service is single-shot — once started, build a new one.
AlreadyStopped
start() was called on a Service that has already stopped.
Reserved for future re-entry protections; currently unreachable.
Trait Implementations§
Source§impl Clone for ServiceError
impl Clone for ServiceError
Source§fn clone(&self) -> ServiceError
fn clone(&self) -> ServiceError
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ServiceError
impl Debug for ServiceError
Source§impl Display for ServiceError
impl Display for ServiceError
Source§impl Error for ServiceError
impl Error for ServiceError
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
use the Display impl or to_string()