-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Make ShellError more readable by consistently using named fields #10700
Copy link
Copy link
Closed
Labels
A:error-unhelpfulThe error message you observe is not helpful to identify the problemThe error message you observe is not helpful to identify the problemcategory:meta-issueAn issue that tracks other issuesAn issue that tracks other issueshelp wantedstatus: Extra attention is neededstatus: Extra attention is needed
Milestone
Description
Our ShellError still has a number of variants that are tuple structs (i.e. unnamed list of types to provide). Especially if there are multiple fields of the same type it is unclear at the creation side of a ShellError which field goes where. This is exacerbated by the fact that for the miette diagnostics we have sometimes format strings that make strong assumptions what should be provided for a particular field.
Thus we should convert each of them to named struct variants (i.e. Identifier { field: type, ... }). While doing so it is worth checking if we use the fields of the error correctly. Sometimes we might need to change incompatible uses of a variant to a different variant.
Variants that need named fields
-
UnsupportedInput -
DatetimeParseError -
NetworkFailure -
CommandNotFound -
AliasNotFound
-FlagNotFound -
FileNotFound -
FileNotFoundCustom -
PluginFailedToLoad -
PluginFailedToEncode -
PluginFailedToDecode -
IOInterrupted -
IOError -
IOErrorSpanned -
PermissionDeniedError -
OutOfMemoryError -
NotADirectory -
DirectoryNotFound -
DirectoryNotFoundCustom -
MoveNotPossibleSingle -
CreateNotPossible -
ChangeAccessTimeNotPossible -
ChangeModifiedTimeNotPossible -
RemoveNotPossible -
NoFileToBeRemoved -
NoFileToBeMoved -
NoFileToBeCopied -
ReadingFile -
DidYouMean -
DidYouMeanCustom -
NonUtf8 -
NonUtf8Custom -
DowncastNotPossible -
UnsupportedConfigValue -
MissingConfigValue -
NeedsPositiveValue -
GenericError -
OutsideSpannedLabeledError -
RemovedCommand -
UnexpectedAbbrComponent -
EvalBlockWithInput -
Break -
Continue -
Return -
NotAConstant -
NotAConstCommand -
NotAConstHelp
Example PRs
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
A:error-unhelpfulThe error message you observe is not helpful to identify the problemThe error message you observe is not helpful to identify the problemcategory:meta-issueAn issue that tracks other issuesAn issue that tracks other issueshelp wantedstatus: Extra attention is neededstatus: Extra attention is needed