logo
#[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
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.

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

Fields

about: &'static str

What it was about.

err: Error

The I/O error which occurred.

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.

err: SendError<(Event, Priority)>

The underlying 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.

err: Box<dyn Error + Send + Sync>

The underlying error.

Error emitted by a Filterer.

Trait Implementations

Formats the value using the given formatter. Read more

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

URL to visit for a more detailed explanation/help about this Diagnostic. Read more

The cause of the error.

Diagnostic severity. This may be used by ReportHandlers to change the display format of this diagnostic. Read more

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

Source code to apply this Diagnostic’s Diagnostic::labels to.

Labels to apply to this Diagnostic’s Diagnostic::source_code

Additional related Diagnostics.

Formats the value using the given formatter. Read more

The lower-level source of this error, if any. Read more

👎Deprecated since 1.42.0:

use the Display impl or to_string()

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

🔬This is a nightly-only experimental API. (error_generic_member_access)

Provides type based access to context intended for error reports. Read more

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

🔬This is a nightly-only experimental API. (provide_any)

Data providers should implement this method to provide all values they are able to provide by using demand. Read more

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more