Error

Enum Error 

Source
pub enum Error {
Show 54 variants SetLocalVarOutsideFunction, TildeWithoutValidHome, AssigningListToArrayMember, ConvertingAssociativeArrayToIndexedArray, ConvertingIndexedArrayToAssociativeArray, FailedSourcingFile(PathBuf, Box<Error>), FailedToSendSignal, CannotAssignToSpecialParameter, CheckedExpansionError(String), FunctionNotFound(String), CommandNotFound(String), HistoryItemNotFound, Unimplemented(&'static str), UnimplementedAndTracked(&'static str, u32), MissingScope, NotADirectory(PathBuf), IsADirectory, NotArray, NoCurrentUser, InvalidRedirection, RedirectionFailure(String, Error), EvalError(EvalError), IntParseError(ParseIntError), TryIntParseError(TryFromIntError), FromUtf8Error(FromUtf8Error), Utf8Error(Utf8Error), ReadonlyVariable, InvalidPattern(String), RegexError(Error), InvalidRegexError(Error, String), IoError(Error), BadSubstitution, InvalidArguments, ChildCreationFailure, FormattingError(Error), ParseError(ParseError), WordParseError(WordParseError), TestCommandParseError(TestCommandParseError), BindingParseError(BindingParseError), ThreadingError(JoinError), InvalidSignal(String), ErrnoError(Errno), InvalidUmask, ProcfsError(ProcError), OpenFileNotReadable(&'static str), OpenFileNotWritable(&'static str), BadFileDescriptor(u32), PrintfFailure(i32), PrintfInvalidUsage(String), Interrupted, MaxFunctionCallDepthExceeded, TimeError(SystemTimeError), ArrayIndexOutOfRange, UnhandledKeyCode(Vec<u8>),
}
Expand description

Monolithic error type for the shell

Variants§

§

SetLocalVarOutsideFunction

A local variable was set outside of a function

§

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, Box<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.

§

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, Error)

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

Invalid substitution syntax.

§

InvalidArguments

Invalid arguments were provided to the command.

§

ChildCreationFailure

An error occurred while creating a child process.

§

FormattingError(Error)

An error occurred while formatting a string.

§

ParseError(ParseError)

An error occurred while parsing.

§

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.

§

ErrnoError(Errno)

A system error occurred.

§

InvalidUmask

An invalid umask was provided.

§

ProcfsError(ProcError)

An error occurred reading from procfs.

§

OpenFileNotReadable(&'static str)

The given open file cannot be read from.

§

OpenFileNotWritable(&'static str)

The given open file cannot be written to.

§

BadFileDescriptor(u32)

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

Array index out of range.

§

UnhandledKeyCode(Vec<u8>)

Unhandled key code.

Trait Implementations§

Source§

impl Debug for Error

Source§

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

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

impl Display for Error

Source§

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

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

impl Error for Error

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<BindingParseError> for Error

Source§

fn from(source: BindingParseError) -> Self

Converts to this type from the input type.
Source§

impl From<Errno> for Error

Source§

fn from(source: Errno) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for Error

Source§

fn from(source: Error) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for Error

Source§

fn from(source: Error) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for Error

Source§

fn from(source: Error) -> Self

Converts to this type from the input type.
Source§

impl From<EvalError> for Error

Source§

fn from(source: EvalError) -> Self

Converts to this type from the input type.
Source§

impl From<FromUtf8Error> for Error

Source§

fn from(source: FromUtf8Error) -> Self

Converts to this type from the input type.
Source§

impl From<JoinError> for Error

Source§

fn from(source: JoinError) -> Self

Converts to this type from the input type.
Source§

impl From<ParseError> for Error

Source§

fn from(source: ParseError) -> Self

Converts to this type from the input type.
Source§

impl From<ParseIntError> for Error

Source§

fn from(source: ParseIntError) -> Self

Converts to this type from the input type.
Source§

impl From<ProcError> for Error

Source§

fn from(source: ProcError) -> Self

Converts to this type from the input type.
Source§

impl From<SystemTimeError> for Error

Source§

fn from(source: SystemTimeError) -> Self

Converts to this type from the input type.
Source§

impl From<TestCommandParseError> for Error

Source§

fn from(source: TestCommandParseError) -> Self

Converts to this type from the input type.
Source§

impl From<TryFromIntError> for Error

Source§

fn from(source: TryFromIntError) -> Self

Converts to this type from the input type.
Source§

impl From<Utf8Error> for Error

Source§

fn from(source: Utf8Error) -> Self

Converts to this type from the input type.
Source§

impl From<WordParseError> for Error

Source§

fn from(source: WordParseError) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl Freeze for Error

§

impl !RefUnwindSafe for Error

§

impl Send for Error

§

impl Sync for Error

§

impl Unpin for Error

§

impl !UnwindSafe for Error

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