ErrorKind

Enum ErrorKind 

Source
pub enum ErrorKind {
Show 59 variants TildeWithoutValidHome, AssigningListToArrayMember, ConvertingAssociativeArrayToIndexedArray, ConvertingIndexedArrayToAssociativeArray, FailedSourcingFile(PathBuf, Error), FailedToSendSignal, CannotAssignToSpecialParameter, CheckedExpansionError(String), FunctionNotFound(String), CommandNotFound(String), BuiltinNotFound(String), WorkingDirMissing(PathBuf), FailedToExecuteCommand(String, Error), HistoryItemNotFound, Unimplemented(&'static str), UnimplementedAndTracked(&'static str, u32), MissingScope, NotADirectory(PathBuf), IsADirectory, NotArray, NoCurrentUser, InvalidRedirection, RedirectionFailure(String, String), EvalError(EvalError), IntParseError(ParseIntError), TryIntParseError(TryFromIntError), FromUtf8Error(FromUtf8Error), Utf8Error(Utf8Error), ReadonlyVariable, InvalidPattern(String), RegexError(Error), InvalidRegexError(Error, String), IoError(Error), BadSubstitution(String), ChildCreationFailure, FormattingError(Error), ParseError(ParseError, SourceInfo), FunctionParseError(String, ParseError), WordParseError(WordParseError), TestCommandParseError(TestCommandParseError), BindingParseError(BindingParseError), ThreadingError(JoinError), InvalidSignal(String), PlatformError(PlatformError), InvalidUmask, OpenFileNotReadable(&'static str), OpenFileNotWritable(&'static str), BadFileDescriptor(ShellFd), PrintfFailure(i32), PrintfInvalidUsage(String), Interrupted, MaxFunctionCallDepthExceeded, TimeError(SystemTimeError), ArrayIndexOutOfRange(i64), UnhandledKeyCode(Vec<u8>), BuiltinError(Box<dyn BuiltinError>, String), NotSupportedOnThisPlatform(&'static str), HistoryNotEnabled, UnknownKeyBindingFunction(String),
}
Expand description

Monolithic error type for the shell

Variants§

§

TildeWithoutValidHome

A tilde expression was used without a valid HOME variable

§

AssigningListToArrayMember

An attempt was made to assign a list to an array member

§

ConvertingAssociativeArrayToIndexedArray

An attempt was made to convert an associative array to an indexed array.

§

ConvertingIndexedArrayToAssociativeArray

An attempt was made to convert an indexed array to an associative array.

§

FailedSourcingFile(PathBuf, Error)

An error occurred while sourcing the indicated script file.

§

FailedToSendSignal

The shell failed to send a signal to a process.

§

CannotAssignToSpecialParameter

An attempt was made to assign a value to a special parameter.

§

CheckedExpansionError(String)

Checked expansion error.

§

FunctionNotFound(String)

A reference was made to an unknown shell function.

§

CommandNotFound(String)

Command was not found.

§

BuiltinNotFound(String)

Not a builtin.

§

WorkingDirMissing(PathBuf)

The working directory does not exist.

§

FailedToExecuteCommand(String, Error)

Failed to execute command.

§

HistoryItemNotFound

History item was not found.

§

Unimplemented(&'static str)

The requested functionality has not yet been implemented in this shell.

§

UnimplementedAndTracked(&'static str, u32)

The requested functionality has not yet been implemented in this shell; it is tracked in a GitHub issue.

§

MissingScope

An expected environment scope could not be found.

§

NotADirectory(PathBuf)

The given path is not a directory.

§

IsADirectory

The given path is a directory.

§

NotArray

The given variable is not an array.

§

NoCurrentUser

The current user could not be determined.

§

InvalidRedirection

The requested input or output redirection is invalid.

§

RedirectionFailure(String, String)

An error occurred while redirecting input or output with the given file.

§

EvalError(EvalError)

An error occurred evaluating an arithmetic expression.

§

IntParseError(ParseIntError)

The given string could not be parsed as an integer.

§

TryIntParseError(TryFromIntError)

The given string could not be parsed as an integer.

§

FromUtf8Error(FromUtf8Error)

A byte sequence could not be decoded as a valid UTF-8 string.

§

Utf8Error(Utf8Error)

A byte sequence could not be decoded as a valid UTF-8 string.

§

ReadonlyVariable

An attempt was made to modify a readonly variable.

§

InvalidPattern(String)

The indicated pattern is invalid.

§

RegexError(Error)

A regular expression error occurred

§

InvalidRegexError(Error, String)

An invalid regular expression was provided.

§

IoError(Error)

An I/O error occurred.

§

BadSubstitution(String)

Invalid substitution syntax.

§

ChildCreationFailure

An error occurred while creating a child process.

§

FormattingError(Error)

An error occurred while formatting a string.

§

ParseError(ParseError, SourceInfo)

An error occurred while parsing.

§

FunctionParseError(String, ParseError)

An error occurred while parsing a function body.

§

WordParseError(WordParseError)

An error occurred while parsing a word.

§

TestCommandParseError(TestCommandParseError)

Unable to parse a test command.

§

BindingParseError(BindingParseError)

Unable to parse a key binding specification.

§

ThreadingError(JoinError)

A threading error occurred.

§

InvalidSignal(String)

An invalid signal was referenced.

§

PlatformError(PlatformError)

A platform error occurred.

§

InvalidUmask

An invalid umask was provided.

§

OpenFileNotReadable(&'static str)

The given open file cannot be read from.

§

OpenFileNotWritable(&'static str)

The given open file cannot be written to.

§

BadFileDescriptor(ShellFd)

Bad file descriptor.

§

PrintfFailure(i32)

Printf failure

§

PrintfInvalidUsage(String)

Printf invalid usage

§

Interrupted

Interrupted

§

MaxFunctionCallDepthExceeded

Maximum function call depth was exceeded.

§

TimeError(SystemTimeError)

System time error.

§

ArrayIndexOutOfRange(i64)

Array index out of range.

§

UnhandledKeyCode(Vec<u8>)

Unhandled key code.

§

BuiltinError(Box<dyn BuiltinError>, String)

An error occurred in a built-in command.

§

NotSupportedOnThisPlatform(&'static str)

Operation not supported on this platform.

§

HistoryNotEnabled

Command history is not enabled in this shell.

§

UnknownKeyBindingFunction(String)

Unknown key binding function.

Trait Implementations§

Source§

impl Debug for ErrorKind

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for ErrorKind

Source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Error for ErrorKind

Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl From<&ErrorKind> for ExecutionExitCode

Source§

fn from(value: &ErrorKind) -> Self

Converts to this type from the input type.
Source§

impl From<BindingParseError> for ErrorKind

Source§

fn from(source: BindingParseError) -> Self

Converts to this type from the input type.
Source§

impl From<Errno> for ErrorKind

Source§

fn from(err: Errno) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for ErrorKind

Source§

fn from(source: Error) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for ErrorKind

Source§

fn from(source: Error) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for ErrorKind

Source§

fn from(source: Error) -> Self

Converts to this type from the input type.
Source§

impl From<EvalError> for ErrorKind

Source§

fn from(source: EvalError) -> Self

Converts to this type from the input type.
Source§

impl From<FromUtf8Error> for ErrorKind

Source§

fn from(source: FromUtf8Error) -> Self

Converts to this type from the input type.
Source§

impl From<JoinError> for ErrorKind

Source§

fn from(source: JoinError) -> Self

Converts to this type from the input type.
Source§

impl From<ParseIntError> for ErrorKind

Source§

fn from(source: ParseIntError) -> Self

Converts to this type from the input type.
Source§

impl From<PlatformError> for ErrorKind

Source§

fn from(source: PlatformError) -> Self

Converts to this type from the input type.
Source§

impl From<SystemTimeError> for ErrorKind

Source§

fn from(source: SystemTimeError) -> Self

Converts to this type from the input type.
Source§

impl From<TestCommandParseError> for ErrorKind

Source§

fn from(source: TestCommandParseError) -> Self

Converts to this type from the input type.
Source§

impl From<TryFromIntError> for ErrorKind

Source§

fn from(source: TryFromIntError) -> Self

Converts to this type from the input type.
Source§

impl From<Utf8Error> for ErrorKind

Source§

fn from(source: Utf8Error) -> Self

Converts to this type from the input type.
Source§

impl From<WordParseError> for ErrorKind

Source§

fn from(source: WordParseError) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> ConvertibleToExitCode for T
where ExecutionExitCode: for<'a> From<&'a T>,

Source§

fn as_exit_code(&self) -> ExecutionExitCode

Converts to an exit code.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

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

fn in_current_span(self) -> Instrumented<Self>

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

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

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
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

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