nu_protocol

Enum ShellError

Source
pub enum ShellError {
Show 106 variants OperatorMismatch { op_span: Span, lhs_ty: String, lhs_span: Span, rhs_ty: String, rhs_span: Span, }, OperatorOverflow { msg: String, span: Span, help: Option<String>, }, PipelineMismatch { exp_input_type: String, dst_span: Span, src_span: Span, }, OnlySupportsThisInputType { exp_input_type: String, wrong_type: String, dst_span: Span, src_span: Span, }, PipelineEmpty { dst_span: Span, }, TypeMismatch { err_message: String, span: Span, }, RuntimeTypeMismatch { expected: Type, actual: Type, span: Span, }, InvalidValue { valid: String, actual: String, span: Span, }, IncorrectValue { msg: String, val_span: Span, call_span: Span, }, UnsupportedOperator { operator: Operator, span: Span, }, AssignmentRequiresVar { lhs_span: Span, }, AssignmentRequiresMutableVar { lhs_span: Span, }, UnknownOperator { op_token: String, span: Span, }, MissingParameter { param_name: String, span: Span, }, IncompatibleParameters { left_message: String, left_span: Span, right_message: String, right_span: Span, }, DelimiterError { msg: String, span: Span, }, IncompatibleParametersSingle { msg: String, span: Span, }, ExternalNotSupported { span: Span, }, InvalidProbability { span: Span, }, InvalidRange { left_flank: String, right_flank: String, span: Span, }, NushellFailed { msg: String, }, NushellFailedSpanned { msg: String, label: String, span: Span, }, NushellFailedHelp { msg: String, help: String, }, VariableNotFoundAtRuntime { span: Span, }, EnvVarNotFoundAtRuntime { envvar_name: String, span: Span, }, ModuleNotFoundAtRuntime { mod_name: String, span: Span, }, OverlayNotFoundAtRuntime { overlay_name: String, span: Span, }, NotFound { span: Span, }, CantConvert { to_type: String, from_type: String, span: Span, help: Option<String>, }, CantConvertToDuration { details: String, dst_span: Span, src_span: Span, help: Option<String>, }, EnvVarNotAString { envvar_name: String, span: Span, }, AutomaticEnvVarSetManually { envvar_name: String, span: Span, }, CannotReplaceEnv { span: Span, }, DivisionByZero { span: Span, }, CannotCreateRange { span: Span, }, AccessBeyondEnd { max_idx: usize, span: Span, }, InsertAfterNextFreeIndex { available_idx: usize, span: Span, }, AccessEmptyContent { span: Span, }, AccessBeyondEndOfStream { span: Span, }, IncompatiblePathAccess { type_name: String, span: Span, }, CantFindColumn { col_name: String, span: Option<Span>, src_span: Span, }, ColumnAlreadyExists { col_name: String, span: Span, src_span: Span, }, NotAList { dst_span: Span, src_span: Span, }, ColumnDefinedTwice { col_name: String, second_use: Span, first_use: Span, }, RecordColsValsMismatch { bad_value: Span, creation_site: Span, }, ExternalCommand { label: String, help: String, span: Span, }, NonZeroExitCode { exit_code: NonZeroI32, span: Span, }, TerminatedBySignal { signal_name: String, signal: i32, span: Span, }, CoreDumped { signal_name: String, signal: i32, span: Span, }, UnsupportedInput { msg: String, input: String, msg_span: Span, input_span: Span, }, DatetimeParseError { msg: String, span: Span, }, NetworkFailure { msg: String, span: Span, }, CommandNotFound { span: Span, }, AliasNotFound { span: Span, }, FileNotFound { file: String, span: Span, }, FileNotFoundCustom { msg: String, span: Span, }, PluginRegistryDataInvalid { plugin_name: String, span: Option<Span>, add_command: String, }, PluginFailedToLoad { msg: String, }, PluginFailedToEncode { msg: String, }, PluginFailedToDecode { msg: String, }, CustomValueIncorrectForPlugin { name: String, span: Span, dest_plugin: String, src_plugin: Option<String>, }, CustomValueFailedToEncode { msg: String, span: Span, }, CustomValueFailedToDecode { msg: String, span: Span, }, IOInterrupted { msg: String, span: Span, }, IOError { msg: String, }, IOErrorSpanned { msg: String, span: Span, }, NotADirectory { span: Span, }, DirectoryNotFound { dir: String, span: Span, }, MoveNotPossible { source_message: String, source_span: Span, destination_message: String, destination_span: Span, }, CreateNotPossible { msg: String, span: Span, }, ChangeAccessTimeNotPossible { msg: String, span: Span, }, ChangeModifiedTimeNotPossible { msg: String, span: Span, }, RemoveNotPossible { msg: String, span: Span, }, ReadingFile { msg: String, span: Span, }, DidYouMean { suggestion: String, span: Span, }, DidYouMeanCustom { msg: String, suggestion: String, span: Span, }, NonUtf8 { span: Span, }, NonUtf8Custom { msg: String, span: Span, }, InvalidConfig { errors: Vec<ConfigError>, }, MissingRequiredColumn { column: &'static str, span: Span, }, NeedsPositiveValue { span: Span, }, GenericError { error: String, msg: String, span: Option<Span>, help: Option<String>, inner: Vec<ShellError>, }, OutsideSpannedLabeledError { src: String, error: String, msg: String, span: Span, }, LabeledError(Box<LabeledError>), RemovedCommand { removed: String, replacement: String, span: Span, }, EvalBlockWithInput { span: Span, sources: Vec<ShellError>, }, Break { span: Span, }, Continue { span: Span, }, Return { span: Span, value: Box<Value>, }, RecursionLimitReached { recursion_limit: u64, span: Option<Span>, }, Interrupted { span: Span, }, InterruptedByUser { span: Option<Span>, }, MatchGuardNotBool { span: Span, }, MissingConstEvalImpl { span: Span, }, NotAConstant { span: Span, }, NotAConstCommand { span: Span, }, NotAConstHelp { span: Span, }, Deprecated { old_command: String, new_suggestion: String, span: Span, url: String, }, InvalidGlobPattern { msg: String, span: Span, }, CannotSpreadAsList { span: Span, }, CannotSpreadAsRecord { span: Span, }, CannotPassListToExternal { arg: String, span: Span, }, OutOfBounds { left_flank: String, right_flank: String, span: Span, }, ConfigDirNotFound { span: Option<Span>, }, InvalidXdgConfig { xdg: String, default: String, }, IrEvalError { msg: String, span: Option<Span>, },
}
Expand description

The fundamental error type for the evaluation engine. These cases represent different kinds of errors the evaluator might face, along with helpful spans to label. An error renderer will take this error value and pass it into an error viewer to display to the user.

Variants§

§

OperatorMismatch

An operator received two arguments of incompatible types.

§Resolution

Check each argument’s type and convert one or both as needed.

Fields

§op_span: Span
§lhs_ty: String
§lhs_span: Span
§rhs_ty: String
§rhs_span: Span
§

OperatorOverflow

An arithmetic operation’s resulting value overflowed its possible size.

§Resolution

Check the inputs to the operation and add guards for their sizes. Integers are generally of size i64, floats are generally f64.

Fields

§span: Span
§

PipelineMismatch

The pipelined input into a command was not of the expected type. For example, it might expect a string input, but received a table instead.

§Resolution

Check the relevant pipeline and extract or convert values as needed.

Fields

§exp_input_type: String
§dst_span: Span
§src_span: Span
§

OnlySupportsThisInputType

The pipelined input into a command was not of the expected type. For example, it might expect a string input, but received a table instead.

(duplicate of ShellError::PipelineMismatch that reports the observed type)

§Resolution

Check the relevant pipeline and extract or convert values as needed.

Fields

§exp_input_type: String
§wrong_type: String
§dst_span: Span
§src_span: Span
§

PipelineEmpty

No input value was piped into the command.

§Resolution

Only use this command to process values from a previous expression.

Fields

§dst_span: Span
§

TypeMismatch

A command received an argument of the wrong type.

§Resolution

Convert the argument type before passing it in, or change the command to accept the type.

Fields

§err_message: String
§span: Span
§

RuntimeTypeMismatch

A value’s type did not match the expected type.

§Resolution

Convert the value to the correct type or provide a value of the correct type.

Fields

§expected: Type
§actual: Type
§span: Span
§

InvalidValue

A value had the correct type but is otherwise invalid.

§Resolution

Ensure the value meets the criteria in the error message.

Fields

§valid: String
§actual: String
§span: Span
§

IncorrectValue

A command received an argument with correct type but incorrect value.

§Resolution

Correct the argument value before passing it in or change the command.

Fields

§val_span: Span
§call_span: Span
§

UnsupportedOperator

This value cannot be used with this operator.

§Resolution

Not all values, for example custom values, can be used with all operators. Either implement support for the operator on this type, or convert the type to a supported one.

Fields

§operator: Operator
§span: Span
§

AssignmentRequiresVar

Invalid assignment left-hand side

§Resolution

Assignment requires that you assign to a variable or variable cell path.

Fields

§lhs_span: Span
§

AssignmentRequiresMutableVar

Invalid assignment left-hand side

§Resolution

Assignment requires that you assign to a mutable variable or cell path.

Fields

§lhs_span: Span
§

UnknownOperator

An operator was not recognized during evaluation.

§Resolution

Did you write the correct operator?

Fields

§op_token: String
§span: Span
§

MissingParameter

An expected command parameter is missing.

§Resolution

Add the expected parameter and try again.

Fields

§param_name: String
§span: Span
§

IncompatibleParameters

Two parameters conflict with each other or are otherwise mutually exclusive.

§Resolution

Remove one of the parameters/options and try again.

Fields

§left_message: String
§left_span: Span
§right_message: String
§right_span: Span
§

DelimiterError

There’s some issue with number or matching of delimiters in an expression.

§Resolution

Check your syntax for mismatched braces, RegExp syntax errors, etc, based on the specific error message.

Fields

§span: Span
§

IncompatibleParametersSingle

An operation received parameters with some sort of incompatibility (for example, different number of rows in a table, incompatible column names, etc).

§Resolution

Refer to the specific error message for details on what’s incompatible and then fix your inputs to make sure they match that way.

Fields

§span: Span
§

ExternalNotSupported

You’re trying to run an unsupported external command.

§Resolution

Make sure there’s an appropriate run-external declaration for this external command.

Fields

§span: Span
§

InvalidProbability

The given probability input is invalid. The probability must be between 0 and 1.

§Resolution

Make sure the probability is between 0 and 1 and try again.

Fields

§span: Span
§

InvalidRange

The first value in a .. range must be compatible with the second one.

§Resolution

Check to make sure both values are compatible, and that the values are enumerable in Nushell.

Fields

§left_flank: String
§right_flank: String
§span: Span
§

NushellFailed

Catastrophic nushell failure. This reflects a completely unexpected or unrecoverable error.

§Resolution

It is very likely that this is a bug. Please file an issue at https://github.com/nushell/nushell/issues with relevant information.

Fields

§

NushellFailedSpanned

Catastrophic nushell failure. This reflects a completely unexpected or unrecoverable error.

§Resolution

It is very likely that this is a bug. Please file an issue at https://github.com/nushell/nushell/issues with relevant information.

Fields

§label: String
§span: Span
§

NushellFailedHelp

Catastrophic nushell failure. This reflects a completely unexpected or unrecoverable error.

§Resolution

It is very likely that this is a bug. Please file an issue at https://github.com/nushell/nushell/issues with relevant information.

Fields

§help: String
§

VariableNotFoundAtRuntime

A referenced variable was not found at runtime.

§Resolution

Check the variable name. Did you typo it? Did you forget to declare it? Is the casing right?

Fields

§span: Span
§

EnvVarNotFoundAtRuntime

A referenced environment variable was not found at runtime.

§Resolution

Check the environment variable name. Did you typo it? Did you forget to declare it? Is the casing right?

Fields

§envvar_name: String
§span: Span
§

ModuleNotFoundAtRuntime

A referenced module was not found at runtime.

§Resolution

Check the module name. Did you typo it? Did you forget to declare it? Is the casing right?

Fields

§mod_name: String
§span: Span
§

OverlayNotFoundAtRuntime

A referenced overlay was not found at runtime.

§Resolution

Check the overlay name. Did you typo it? Did you forget to declare it? Is the casing right?

Fields

§overlay_name: String
§span: Span
§

NotFound

The given item was not found. This is a fairly generic error that depends on context.

§Resolution

This error is triggered in various places, and simply signals that “something” was not found. Refer to the specific error message for further details.

Fields

§span: Span
§

CantConvert

Failed to convert a value of one type into a different type.

§Resolution

Not all values can be coerced this way. Check the supported type(s) and try again.

Fields

§to_type: String
§from_type: String
§span: Span
§

CantConvertToDuration

Fields

§details: String
§dst_span: Span
§src_span: Span
§

EnvVarNotAString

An environment variable cannot be represented as a string.

§Resolution

Not all types can be converted to environment variable values, which must be strings. Check the input type and try again.

Fields

§envvar_name: String
§span: Span
§

AutomaticEnvVarSetManually

This environment variable cannot be set manually.

§Resolution

This environment variable is set automatically by Nushell and cannot not be set manually.

Fields

§envvar_name: String
§span: Span
§

CannotReplaceEnv

It is not possible to replace the entire environment at once

§Resolution

Setting the entire environment is not allowed. Change environment variables individually instead.

Fields

§span: Span
§

DivisionByZero

Division by zero is not a thing.

§Resolution

Add a guard of some sort to check whether a denominator input to this division is zero, and branch off if that’s the case.

Fields

§span: Span
§

CannotCreateRange

An error happened while trying to create a range.

This can happen in various unexpected situations, for example if the range would loop forever (as would be the case with a 0-increment).

§Resolution

Check your range values to make sure they’re countable and would not loop forever.

Fields

§span: Span
§

AccessBeyondEnd

You attempted to access an index beyond the available length of a value.

§Resolution

Check your lengths and try again.

Fields

§max_idx: usize
§span: Span
§

InsertAfterNextFreeIndex

You attempted to insert data at a list position higher than the end.

§Resolution

To insert data into a list, assign to the last used index + 1.

Fields

§available_idx: usize
§span: Span
§

AccessEmptyContent

You attempted to access an index when it’s empty.

§Resolution

Check your lengths and try again.

Fields

§span: Span
§

AccessBeyondEndOfStream

You attempted to access an index beyond the available length of a stream.

§Resolution

Check your lengths and try again.

Fields

§span: Span
§

IncompatiblePathAccess

Tried to index into a type that does not support pathed access.

§Resolution

Check your types. Only composite types can be pathed into.

Fields

§type_name: String
§span: Span
§

CantFindColumn

The requested column does not exist.

§Resolution

Check the spelling of your column name. Did you forget to rename a column somewhere?

Fields

§col_name: String
§span: Option<Span>
§src_span: Span
§

ColumnAlreadyExists

Attempted to insert a column into a table, but a column with that name already exists.

§Resolution

Drop or rename the existing column (check rename -h) and try again.

Fields

§col_name: String
§span: Span
§src_span: Span
§

NotAList

The given operation can only be performed on lists.

§Resolution

Check the input type to this command. Are you sure it’s a list?

Fields

§dst_span: Span
§src_span: Span
§

ColumnDefinedTwice

Fields can only be defined once

§Resolution

Check the record to ensure you aren’t reusing the same field name

Fields

§col_name: String
§second_use: Span
§first_use: Span
§

RecordColsValsMismatch

Attempted to create a record from different number of columns and values

§Resolution

Check the record has the same number of columns as values

Fields

§bad_value: Span
§creation_site: Span
§

ExternalCommand

An error happened while performing an external command.

§Resolution

This error is fairly generic. Refer to the specific error message for further details.

Fields

§label: String
§help: String
§span: Span
§

NonZeroExitCode

An external command exited with a non-zero exit code.

§Resolution

Check the external command’s error message.

Fields

§exit_code: NonZeroI32
§span: Span
§

TerminatedBySignal

An external command exited due to a signal.

§Resolution

Check why the signal was sent or triggered.

Fields

§signal_name: String
§signal: i32
§span: Span
§

CoreDumped

An external command core dumped.

§Resolution

Check why the core dumped was triggered.

Fields

§signal_name: String
§signal: i32
§span: Span
§

UnsupportedInput

An operation was attempted with an input unsupported for some reason.

§Resolution

This error is fairly generic. Refer to the specific error message for further details.

Fields

§input: String
§msg_span: Span
§input_span: Span
§

DatetimeParseError

Failed to parse an input into a datetime value.

§Resolution

Make sure your datetime input format is correct.

For example, these are some valid formats:

  • “5 pm”
  • “2020/12/4”
  • “2020.12.04 22:10 +2”
  • “2020-04-12 22:10:57 +02:00”
  • “2020-04-12T22:10:57.213231+02:00”
  • “Tue, 1 Jul 2003 10:52:37 +0200”“#

Fields

§span: Span
§

NetworkFailure

A network operation failed.

§Resolution

It’s always DNS.

Fields

§span: Span
§

CommandNotFound

Help text for this command could not be found.

§Resolution

Check the spelling for the requested command and try again. Are you sure it’s defined and your configurations are loading correctly? Can you execute it?

Fields

§span: Span
§

AliasNotFound

This alias could not be found

§Resolution

The alias does not exist in the current scope. It might exist in another scope or overlay or be hidden.

Fields

§span: Span
§

FileNotFound

Failed to find a file during a nushell operation.

§Resolution

Does the file in the error message exist? Is it readable and accessible? Is the casing right?

Fields

§file: String
§span: Span
§

FileNotFoundCustom

Failed to find a file during a nushell operation.

§Resolution

Does the file in the error message exist? Is it readable and accessible? Is the casing right?

Fields

§span: Span
§

PluginRegistryDataInvalid

The registered plugin data for a plugin is invalid.

§Resolution

plugin add the plugin again to update the data, or remove it with plugin rm.

Fields

§plugin_name: String
§span: Option<Span>
§add_command: String
§

PluginFailedToLoad

A plugin failed to load.

§Resolution

This is a fairly generic error. Refer to the specific error message for further details.

Fields

§

PluginFailedToEncode

A message from a plugin failed to encode.

§Resolution

This is likely a bug with the plugin itself.

Fields

§

PluginFailedToDecode

A message to a plugin failed to decode.

§Resolution

This is either an issue with the inputs to a plugin (bad JSON?) or a bug in the plugin itself. Fix or report as appropriate.

Fields

§

CustomValueIncorrectForPlugin

A custom value cannot be sent to the given plugin.

§Resolution

Custom values can only be used with the plugin they came from. Use a command from that plugin instead.

Fields

§name: String
§span: Span
§dest_plugin: String
§src_plugin: Option<String>
§

CustomValueFailedToEncode

The plugin failed to encode a custom value.

§Resolution

This is likely a bug with the plugin itself. The plugin may have tried to send a custom value that is not serializable.

Fields

§span: Span
§

CustomValueFailedToDecode

The plugin failed to encode a custom value.

§Resolution

This may be a bug within the plugin, or the plugin may have been updated in between the creation of the custom value and its use.

Fields

§span: Span
§

IOInterrupted

I/O operation interrupted.

§Resolution

This is a generic error. Refer to the specific error message for further details.

Fields

§span: Span
§

IOError

An I/O operation failed.

§Resolution

This is a generic error. Refer to the specific error message for further details.

Fields

§

IOErrorSpanned

An I/O operation failed.

§Resolution

This is a generic error. Refer to the specific error message for further details.

Fields

§span: Span
§

NotADirectory

Tried to cd to a path that isn’t a directory.

§Resolution

Make sure the path is a directory. It currently exists, but is of some other type, like a file.

Fields

§span: Span
§

DirectoryNotFound

Attempted to perform an operation on a directory that doesn’t exist.

§Resolution

Make sure the directory in the error message actually exists before trying again.

Fields

§span: Span
§

MoveNotPossible

The requested move operation cannot be completed. This is typically because both paths exist, but are of different types. For example, you might be trying to overwrite an existing file with a directory.

§Resolution

Make sure the destination path does not exist before moving a directory.

Fields

§source_message: String
§source_span: Span
§destination_message: String
§destination_span: Span
§

CreateNotPossible

Failed to create either a file or directory.

§Resolution

This is a fairly generic error. Refer to the specific error message for further details.

Fields

§span: Span
§

ChangeAccessTimeNotPossible

Changing the access time (“atime”) of this file is not possible.

§Resolution

This can be for various reasons, such as your platform or permission flags. Refer to the specific error message for more details.

Fields

§span: Span
§

ChangeModifiedTimeNotPossible

Changing the modification time (“mtime”) of this file is not possible.

§Resolution

This can be for various reasons, such as your platform or permission flags. Refer to the specific error message for more details.

Fields

§span: Span
§

RemoveNotPossible

Unable to remove this item.

§Resolution

Removal can fail for a number of reasons, such as permissions problems. Refer to the specific error message for more details.

Fields

§span: Span
§

ReadingFile

Error while trying to read a file

§Resolution

The error will show the result from a file operation

Fields

§span: Span
§

DidYouMean

A name was not found. Did you mean a different name?

§Resolution

The error message will suggest a possible match for what you meant.

Fields

§suggestion: String
§span: Span
§

DidYouMeanCustom

A name was not found. Did you mean a different name?

§Resolution

The error message will suggest a possible match for what you meant.

Fields

§suggestion: String
§span: Span
§

NonUtf8

The given input must be valid UTF-8 for further processing.

§Resolution

Check your input’s encoding. Are there any funny characters/bytes?

Fields

§span: Span
§

NonUtf8Custom

The given input must be valid UTF-8 for further processing.

§Resolution

Check your input’s encoding. Are there any funny characters/bytes?

Fields

§span: Span
§

InvalidConfig

Failed to update the config due to one or more errors.

§Resolution

Refer to the error messages for specific details.

Fields

§

MissingRequiredColumn

A value was missing a required column.

§Resolution

Make sure the value has the required column.

Fields

§column: &'static str
§span: Span
§

NeedsPositiveValue

Negative value passed when positive one is required.

§Resolution

Guard against negative values or check your inputs.

Fields

§span: Span
§

GenericError

This is a generic error type used for different situations.

Fields

§error: String
§span: Option<Span>
§

OutsideSpannedLabeledError

This is a generic error type used for different situations.

Fields

§error: String
§span: Span
§

LabeledError(Box<LabeledError>)

This is a generic error type used for user and plugin-generated errors.

§

RemovedCommand

Attempted to use a command that has been removed from Nushell.

§Resolution

Check the help for the new suggested command and update your script accordingly.

Fields

§removed: String
§replacement: String
§span: Span
§

EvalBlockWithInput

Failed to eval block with specific pipeline input.

Fields

§span: Span
§sources: Vec<ShellError>
§

Break

Break event, which may become an error if used outside of a loop

Fields

§span: Span
§

Continue

Continue event, which may become an error if used outside of a loop

Fields

§span: Span
§

Return

Return event, which may become an error if used outside of a function

Fields

§span: Span
§value: Box<Value>
§

RecursionLimitReached

The code being executed called itself too many times.

§Resolution

Adjust your Nu code to

Fields

§recursion_limit: u64
§span: Option<Span>
§

Interrupted

Operation interrupted

Fields

§span: Span
§

InterruptedByUser

Operation interrupted by user

Fields

§span: Option<Span>
§

MatchGuardNotBool

An attempt to use, as a match guard, an expression that does not resolve into a boolean

Fields

§span: Span
§

MissingConstEvalImpl

An attempt to run a command marked for constant evaluation lacking the const. eval. implementation.

This is an internal Nushell error, please file an issue.

Fields

§span: Span
§

NotAConstant

Tried assigning non-constant value to a constant

§Resolution

Only a subset of expressions are allowed to be assigned as a constant during parsing.

Fields

§span: Span
§

NotAConstCommand

Tried running a command that is not const-compatible

§Resolution

Only a subset of builtin commands, and custom commands built only from those commands, can run at parse time.

Fields

§span: Span
§

NotAConstHelp

Tried getting a help message at parse time.

§Resolution

Help messages are not supported at parse time.

Fields

§span: Span
§

Deprecated

Fields

§old_command: String
§new_suggestion: String
§span: Span
§

InvalidGlobPattern

Invalid glob pattern

§Resolution

Correct glob pattern

Fields

§span: Span
§

CannotSpreadAsList

Tried spreading a non-list inside a list or command call.

§Resolution

Only lists can be spread inside lists and command calls. Try converting the value to a list before spreading.

Fields

§span: Span
§

CannotSpreadAsRecord

Tried spreading a non-record inside a record.

§Resolution

Only records can be spread inside records. Try converting the value to a record before spreading.

Fields

§span: Span
§

CannotPassListToExternal

Lists are not automatically spread when calling external commands

§Resolution

Use the spread operator (put a ‘…’ before the argument)

Fields

§span: Span
§

OutOfBounds

Out of bounds.

§Resolution

Make sure the range is within the bounds of the input.

Fields

§left_flank: String
§right_flank: String
§span: Span
§

ConfigDirNotFound

The config directory could not be found

Fields

§span: Option<Span>
§

InvalidXdgConfig

XDG_CONFIG_HOME was set to an invalid path

Fields

§default: String
§

IrEvalError

An unexpected error occurred during IR evaluation.

§Resolution

This is most likely a correctness issue with the IR compiler or evaluator. Please file a bug with the minimum code needed to reproduce the issue, if possible.

Fields

§span: Option<Span>

Implementations§

Source§

impl ShellError

Source

pub fn external_exit_code(&self) -> Option<Spanned<i32>>

Source

pub fn exit_code(&self) -> Option<i32>

Source

pub fn into_value(self, span: Span, fancy_errors: bool) -> Value

Source

pub fn wrap(self, working_set: &StateWorkingSet<'_>, span: Span) -> ParseError

Source

pub fn render_error_to_string( diag: impl Diagnostic, fancy_errors: bool, ) -> String

Trait Implementations§

Source§

impl Clone for ShellError

Source§

fn clone(&self) -> ShellError

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ShellError

Source§

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

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

impl<'de> Deserialize<'de> for ShellError

ShellError always deserializes as if it were LabeledError, resulting in a ShellError::LabeledError variant.

Source§

fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Diagnostic for ShellError

Source§

fn code(&self) -> Option<Box<dyn Display + '_>>

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

fn help(&self) -> Option<Box<dyn Display + '_>>

Additional help text related to this Diagnostic. Do you have any advice for the poor soul who’s just run into this issue?
Source§

fn severity(&self) -> Option<Severity>

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

fn labels(&self) -> Option<Box<dyn Iterator<Item = LabeledSpan> + '_>>

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

fn source_code(&self) -> Option<&dyn SourceCode>

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

fn related(&self) -> Option<Box<dyn Iterator<Item = &dyn Diagnostic> + '_>>

Additional related Diagnostics.
Source§

fn url(&self) -> Option<Box<dyn Display + '_>>

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

fn diagnostic_source(&self) -> Option<&dyn Diagnostic>

The cause of the error.
Source§

impl Display for ShellError

Source§

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

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

impl Error for ShellError

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<Box<LabeledError>> for ShellError

Source§

fn from(source: Box<LabeledError>) -> Self

Converts to this type from the input type.
Source§

impl From<Box<dyn Error>> for ShellError

Source§

fn from(error: Box<dyn Error>) -> ShellError

Converts to this type from the input type.
Source§

impl From<Box<dyn Error + Send + Sync>> for ShellError

Source§

fn from(error: Box<dyn Error + Send + Sync>) -> ShellError

Converts to this type from the input type.
Source§

impl From<Error> for ShellError

Source§

fn from(error: Error) -> ShellError

Converts to this type from the input type.
Source§

impl From<LabeledError> for ShellError

Source§

fn from(error: LabeledError) -> Self

Converts to this type from the input type.
Source§

impl From<ShellError> for ConfigError

Source§

fn from(source: ShellError) -> Self

Converts to this type from the input type.
Source§

impl From<ShellError> for Error

Source§

fn from(error: ShellError) -> Self

Converts to this type from the input type.
Source§

impl From<ShellError> for LabeledError

Source§

fn from(err: ShellError) -> Self

Converts to this type from the input type.
Source§

impl From<Spanned<Error>> for ShellError

Source§

fn from(error: Spanned<Error>) -> Self

Converts to this type from the input type.
Source§

impl From<Spanned<InvalidPluginFilename>> for ShellError

Source§

fn from(error: Spanned<InvalidPluginFilename>) -> ShellError

Converts to this type from the input type.
Source§

impl IntoValue for ShellError

Source§

fn into_value(self, span: Span) -> Value

Converts the given value to a Value.
Source§

impl PartialEq for ShellError

Source§

fn eq(&self, other: &ShellError) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for ShellError

ShellError always serializes as LabeledError.

Source§

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for ShellError

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> IntoSpanned for T

Source§

fn into_spanned(self, span: Span) -> Spanned<T>

Wrap items together with a span into Spanned. Read more
Source§

impl<D> OwoColorize for D

Source§

fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>
where C: Color,

Set the foreground color generically Read more
Source§

fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>
where C: Color,

Set the background color generically. Read more
Source§

fn black(&self) -> FgColorDisplay<'_, Black, Self>

Change the foreground color to black
Source§

fn on_black(&self) -> BgColorDisplay<'_, Black, Self>

Change the background color to black
Source§

fn red(&self) -> FgColorDisplay<'_, Red, Self>

Change the foreground color to red
Source§

fn on_red(&self) -> BgColorDisplay<'_, Red, Self>

Change the background color to red
Source§

fn green(&self) -> FgColorDisplay<'_, Green, Self>

Change the foreground color to green
Source§

fn on_green(&self) -> BgColorDisplay<'_, Green, Self>

Change the background color to green
Source§

fn yellow(&self) -> FgColorDisplay<'_, Yellow, Self>

Change the foreground color to yellow
Source§

fn on_yellow(&self) -> BgColorDisplay<'_, Yellow, Self>

Change the background color to yellow
Source§

fn blue(&self) -> FgColorDisplay<'_, Blue, Self>

Change the foreground color to blue
Source§

fn on_blue(&self) -> BgColorDisplay<'_, Blue, Self>

Change the background color to blue
Source§

fn magenta(&self) -> FgColorDisplay<'_, Magenta, Self>

Change the foreground color to magenta
Source§

fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>

Change the background color to magenta
Source§

fn purple(&self) -> FgColorDisplay<'_, Magenta, Self>

Change the foreground color to purple
Source§

fn on_purple(&self) -> BgColorDisplay<'_, Magenta, Self>

Change the background color to purple
Source§

fn cyan(&self) -> FgColorDisplay<'_, Cyan, Self>

Change the foreground color to cyan
Source§

fn on_cyan(&self) -> BgColorDisplay<'_, Cyan, Self>

Change the background color to cyan
Source§

fn white(&self) -> FgColorDisplay<'_, White, Self>

Change the foreground color to white
Source§

fn on_white(&self) -> BgColorDisplay<'_, White, Self>

Change the background color to white
Source§

fn default_color(&self) -> FgColorDisplay<'_, Default, Self>

Change the foreground color to the terminal default
Source§

fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>

Change the background color to the terminal default
Source§

fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>

Change the foreground color to bright black
Source§

fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>

Change the background color to bright black
Source§

fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>

Change the foreground color to bright red
Source§

fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>

Change the background color to bright red
Source§

fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>

Change the foreground color to bright green
Source§

fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>

Change the background color to bright green
Source§

fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>

Change the foreground color to bright yellow
Source§

fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>

Change the background color to bright yellow
Source§

fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>

Change the foreground color to bright blue
Source§

fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>

Change the background color to bright blue
Source§

fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>

Change the foreground color to bright magenta
Source§

fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>

Change the background color to bright magenta
Source§

fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>

Change the foreground color to bright purple
Source§

fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>

Change the background color to bright purple
Source§

fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>

Change the foreground color to bright cyan
Source§

fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>

Change the background color to bright cyan
Source§

fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>

Change the foreground color to bright white
Source§

fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>

Change the background color to bright white
Source§

fn bold(&self) -> BoldDisplay<'_, Self>

Make the text bold
Source§

fn dimmed(&self) -> DimDisplay<'_, Self>

Make the text dim
Source§

fn italic(&self) -> ItalicDisplay<'_, Self>

Make the text italicized
Source§

fn underline(&self) -> UnderlineDisplay<'_, Self>

Make the text underlined
Make the text blink
Make the text blink (but fast!)
Source§

fn reversed(&self) -> ReversedDisplay<'_, Self>

Swap the foreground and background colors
Source§

fn hidden(&self) -> HiddenDisplay<'_, Self>

Hide the text
Source§

fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>

Cross out the text
Source§

fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>
where Color: DynColor,

Set the foreground color at runtime. Only use if you do not know which color will be used at compile-time. If the color is constant, use either OwoColorize::fg or a color-specific method, such as OwoColorize::green, Read more
Source§

fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>
where Color: DynColor,

Set the background color at runtime. Only use if you do not know what color to use at compile-time. If the color is constant, use either OwoColorize::bg or a color-specific method, such as OwoColorize::on_yellow, Read more
Source§

fn fg_rgb<const R: u8, const G: u8, const B: u8>( &self, ) -> FgColorDisplay<'_, CustomColor<R, G, B>, Self>

Set the foreground color to a specific RGB value.
Source§

fn bg_rgb<const R: u8, const G: u8, const B: u8>( &self, ) -> BgColorDisplay<'_, CustomColor<R, G, B>, Self>

Set the background color to a specific RGB value.
Source§

fn truecolor(&self, r: u8, g: u8, b: u8) -> FgDynColorDisplay<'_, Rgb, Self>

Sets the foreground color to an RGB value.
Source§

fn on_truecolor(&self, r: u8, g: u8, b: u8) -> BgDynColorDisplay<'_, Rgb, Self>

Sets the background color to an RGB value.
Source§

fn style(&self, style: Style) -> Styled<&Self>

Apply a runtime-determined style
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize = _

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Serialize for T
where T: Serialize + ?Sized,

Source§

fn erased_serialize(&self, serializer: &mut dyn Serializer) -> Result<(), Error>

Source§

fn do_erased_serialize( &self, serializer: &mut dyn Serializer, ) -> Result<(), ErrorImpl>

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

default 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<T> TryIntoValue for T
where T: IntoValue,

Source§

fn try_into_value(self, span: Span) -> Result<Value, ShellError>

Tries to convert the given value into a Value.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,