logo
#[non_exhaustive]
pub enum RuntimeError {
Show 20 variants Exit, External(Box<dyn Error + Send + Sync>), IoError { about: &'static str, err: Error, }, FsWatcherCreate { kind: Watcher, err: Error, }, FsWatcherEvent { kind: Watcher, err: Error, }, FsWatcherPathAdd { path: PathBuf, kind: Watcher, err: Error, }, FsWatcherPathRemove { path: PathBuf, kind: Watcher, err: Error, }, InternalSupervisor(String), EventChannelSend { ctx: &'static str, err: SendError<Event>, }, EventChannelTrySend { ctx: &'static str, err: TrySendError<Event>, }, Handler { ctx: &'static str, err: String, }, HandlerLockHeld(&'static str), Process(Error), ProcessDeadOnArrival, UnsupportedSignal(SubSignal), Clearscreen(Error), GlobsetGlob { file: Option<PathBuf>, err: Error, }, IgnoreFileRead { file: PathBuf, err: Error, }, Filterer { kind: &'static str, err: Box<dyn Error + Send + Sync>, }, Set(Vec<RuntimeError>),
}
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.

FsWatcherCreate

Fields

kind: Watcher

The kind of watcher that failed to instantiate.

err: Error

The underlying error.

Error received when creating a filesystem watcher fails.

FsWatcherEvent

Fields

kind: Watcher

The kind of watcher that failed to read an event.

err: Error

The underlying error.

Error received when reading a filesystem event fails.

FsWatcherPathAdd

Fields

path: PathBuf

The path that was attempted to be added.

kind: Watcher

The kind of watcher that failed to add a path.

err: Error

The underlying error.

Error received when adding to the pathset for the filesystem watcher fails.

FsWatcherPathRemove

Fields

path: PathBuf

The path that was attempted to be removed.

kind: Watcher

The kind of watcher that failed to remove a path.

err: Error

The underlying error.

Error received when removing from the pathset for the filesystem watcher fails.

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>

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>

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.

Clearscreen(Error)

Error received when clearing the screen.

GlobsetGlob

Fields

file: Option<PathBuf>

The path to the erroring ignore file.

err: Error

The underlying error.

Error received when parsing a glob (possibly from an IgnoreFile) fails.

IgnoreFileRead

Fields

file: PathBuf

The path to the erroring ignore file.

err: Error

The underlying error.

Error received when an IgnoreFile cannot be read.

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.

With built-in filterers this will probably be a dynbox of TaggedFiltererError, but it is possible to use a custom filterer which emits a different error type.

Set(Vec<RuntimeError>)

A set of related RuntimeErrors.

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

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

Additional related Diagnostics.

Diagnostic severity. This may be used by [ReportHandler]s to change the display format of this diagnostic. Read more

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

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

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

Formats the value using the given formatter. Read more

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

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

Returns a stack backtrace, if available, of where this error occurred. 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

Performs the conversion.

Performs the conversion.

Performs the conversion.

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

Performs the conversion.

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

Performs the conversion.

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