make "can't follow stream paths" error a bit better#10569
Merged
sholderbach merged 4 commits intonushell:mainfrom Oct 3, 2023
Merged
make "can't follow stream paths" error a bit better#10569sholderbach merged 4 commits intonushell:mainfrom
sholderbach merged 4 commits intonushell:mainfrom
Conversation
errors look like
```nushell
> update value (get value)
Error: nu::shell::io_error
× I/O error
help: can't follow path '[String { val: "value", span: Span { start: 243376, end: 243381 }, optional: false }]' in empty stream
```
```nushell
> ^echo "foo" | get 0
Error: nu::shell::io_error
× I/O error
╭─[entry #3:1:1]
1 │ ^echo "foo" | get 0
· ──┬─
· ╰── can't follow path '[Int { val: 0, span: Span { start: 243417, end: 243418 }, optional: false }]' in external stream
╰────
```
errors look like ```nushell > update value (get value) Error: nu::shell::io_error × I/O error help: can't follow path 'value' in empty stream ``` ```nushell > ^echo "foo" | get 0 Error: nu::shell::io_error × I/O error ╭─[entry #2:1:1] 1 │ ^echo "foo" | get 0 · ──┬─ · ╰── can't follow path '0' in external stream ╰──── ```
sholderbach
reviewed
Oct 2, 2023
Member
sholderbach
left a comment
There was a problem hiding this comment.
Thanks for spanning this error.
I think IOError is misleading here, as the failing operation is the look up. Our closest existing variant may be IncompatiblePathAccess, that would need some adjustment in other places if you want to include the path as well.
Member
Author
|
@sholderbach |
hardfau1t
pushed a commit
to hardfau1t/nushell
that referenced
this pull request
Dec 14, 2023
related to - nushell#9373 - nushell#8639 might be able to close nushell#8639? # Description "can't follow stream paths" errors have always been a bit scary and obnoxious because they give no information about what happens... in this PR i try to slightly improve the error message by telling if the stream was empty or not and give span information when available. # User-Facing Changes ```nushell > update value (get value) Error: nu::shell::incompatible_path_access × Data cannot be accessed with a cell path ╭─[entry #1:1:1] 1 │ update value (get value) · ─┬─ · ╰── empty pipeline doesn't support cell paths ╰──── ``` ```nushell > ^echo "foo" | get 0 Error: nu:🐚:incompatible_path_access × Data cannot be accessed with a cell path ╭─[entry nushell#2:1:1] 1 │ ^echo "foo" | get 0 · ──┬─ · ╰── external stream doesn't support cell paths ╰──── ``` # Tests + Formatting # After Submitting
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
related to
might be able to close #8639?
Description
"can't follow stream paths" errors have always been a bit scary and obnoxious because they give no information about what happens...
in this PR i try to slightly improve the error message by telling if the stream was empty or not and give span information when available.
User-Facing Changes
Tests + Formatting
After Submitting