Enum watchexec::error::RuntimeError
source · [−]#[non_exhaustive]
pub enum RuntimeError {
Show 18 variants
Exit,
External(Box<dyn Error + Send + Sync>),
IoError {
about: &'static str,
err: Error,
},
FsWatcher {
kind: Watcher,
err: FsWatcherError,
},
InternalSupervisor(String),
EventChannelSend {
ctx: &'static str,
err: SendError<(Event, Priority)>,
},
EventChannelTrySend {
ctx: &'static str,
err: TrySendError<(Event, Priority)>,
},
Handler {
ctx: &'static str,
err: String,
},
HandlerLockHeld(&'static str),
Process(Error),
ProcessDeadOnArrival,
UnsupportedSignal(SubSignal),
NoCommands,
CommandShellEmptyCommand,
CommandShellEmptyShell,
Clearscreen(Error),
IgnoreFiles(Error),
Filterer {
kind: &'static str,
err: Box<dyn Error + Send + Sync>,
},
}
Expand description
Errors which may be recoverable, transient, or only affect a part of the operation, and should be reported to the user and/or acted upon programatically, but will not outright stop watchexec.
Variants (Non-exhaustive)
This enum is marked as non-exhaustive
Exit
Pseudo-error used to signal a graceful exit.
External(Box<dyn Error + Send + Sync>)
For custom runtime errors.
This should be used for errors by external code which are not covered by the other error types; watchexec-internal errors should never use this.
IoError
Generic I/O error, with some context.
FsWatcher
Fields
kind: Watcher
The kind of watcher that failed to instantiate.
err: FsWatcherError
The underlying error.
Events from the filesystem watcher event source.
InternalSupervisor(String)
Opaque internal error from a command supervisor.
EventChannelSend
Fields
ctx: &'static str
The context in which this error happened.
This is not stable and its value should not be relied on except for printing the error.
Error received when an event cannot be sent to the event channel.
EventChannelTrySend
Fields
ctx: &'static str
The context in which this error happened.
This is not stable and its value should not be relied on except for printing the error.
err: TrySendError<(Event, Priority)>
The underlying error.
Error received when an event cannot be sent to the event channel.
Handler
Fields
ctx: &'static str
The context in which this error happened.
This is not stable and its value should not be relied on except for printing the error.
err: String
The underlying error, as the Display representation of the original error.
Error received when a Handler
errors.
The error is completely opaque, having been flattened into a string at the error point.
HandlerLockHeld(&'static str)
Error received when a Handler
which has been passed a lock has kept that lock open after the handler has completed.
Process(Error)
Error received when operating on a process.
ProcessDeadOnArrival
Error received when a process did not start correctly, or finished before we could even tell.
UnsupportedSignal(SubSignal)
Error received when a SubSignal
is unsupported
This may happen if the signal is not supported on the current platform, or if Watchexec doesn’t support sending the signal.
NoCommands
Error received when there are no commands to run.
This is generally a programmer error and should be caught earlier.
CommandShellEmptyCommand
Error received when trying to render a Command::Shell
that has no command
This is generally a programmer error and should be caught earlier.
CommandShellEmptyShell
Error received when trying to render a Shell::Unix
with an empty shell
This is generally a programmer error and should be caught earlier.
Clearscreen(Error)
Error received when clearing the screen.
IgnoreFiles(Error)
Error received from the ignore-files
crate.
Filterer
Fields
kind: &'static str
The kind of filterer that failed.
This should be set by the filterer itself to a short name for the filterer.
This is not stable and its value should not be relied on except for printing the error.
Error emitted by a Filterer
.
Trait Implementations
sourceimpl Debug for RuntimeError
impl Debug for RuntimeError
sourceimpl Diagnostic for RuntimeError
impl Diagnostic for RuntimeError
sourcefn code<'a>(&'a self) -> Option<Box<dyn Display + 'a>>
fn code<'a>(&'a self) -> Option<Box<dyn Display + 'a>>
Unique diagnostic code that can be used to look up more information
about this Diagnostic
. Ideally also globally unique, and documented
in the toplevel crate’s documentation for easy searching. Rust path
format (foo::bar::baz
) is recommended, but more classic codes like
E0123
or enums will work just fine. Read more
sourcefn url<'a>(&'a self) -> Option<Box<dyn Display + 'a>>
fn url<'a>(&'a self) -> Option<Box<dyn Display + 'a>>
URL to visit for a more detailed explanation/help about this
Diagnostic
. Read more
sourcefn diagnostic_source(&self) -> Option<&dyn Diagnostic>
fn diagnostic_source(&self) -> Option<&dyn Diagnostic>
The cause of the error.
sourcefn severity(&self) -> Option<Severity>
fn severity(&self) -> Option<Severity>
Diagnostic severity. This may be used by
ReportHandler
s to change the display format
of this diagnostic. Read more
sourcefn help(&'a self) -> Option<Box<dyn Display + 'a, Global>>
fn help(&'a self) -> Option<Box<dyn Display + 'a, Global>>
Additional help text related to this Diagnostic
. Do you have any
advice for the poor soul who’s just run into this issue? Read more
sourcefn source_code(&self) -> Option<&dyn SourceCode>
fn source_code(&self) -> Option<&dyn SourceCode>
Source code to apply this Diagnostic
’s Diagnostic::labels
to.
sourcefn labels(&self) -> Option<Box<dyn Iterator<Item = LabeledSpan>, Global>>
fn labels(&self) -> Option<Box<dyn Iterator<Item = LabeledSpan>, Global>>
Labels to apply to this Diagnostic
’s Diagnostic::source_code
Additional related Diagnostic
s.
sourceimpl Display for RuntimeError
impl Display for RuntimeError
sourceimpl Error for RuntimeError
impl Error for RuntimeError
sourcefn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more
1.0.0 · sourcefn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
sourceimpl From<Error> for RuntimeError
impl From<Error> for RuntimeError
Auto Trait Implementations
impl !RefUnwindSafe for RuntimeError
impl Send for RuntimeError
impl Sync for RuntimeError
impl Unpin for RuntimeError
impl !UnwindSafe for RuntimeError
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more