You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Errors, where possible, should show both use and origin for erroring values #4326
Error: nu::shell::type_mismatch (link)
× Type mismatch during operation.
╭─[entry nushell/engine-q#1:1:1]
1 │ benchmark { echo a | each { $it + 10 } | length }
· ┬ ┬ ─┬
· │ │ ╰── int
· │ ╰── type mismatch for operator
· ╰── string
╰────
Now:
Error: nu::shell::type_mismatch (link)
× Type mismatch during operation.
╭─[entry nushell/engine-q#8:1:1]
1 │ benchmark { echo a | each { $it + 10 } | length }
· ─┬─ ┬ ─┬
· │ │ ╰── int
· │ ╰── type mismatch for operator
· ╰── string
╰────
While the second one is easier to debug, ideally we'd like to have both. Show the error on the use, but then have a secondary span that points to where this value originated.
Activity
sophiajt commentedon Aug 9, 2023
After reviewing this, I think the second example is preferable as you are more focused on the error.
Closing for now, but we should probably do a bit of an error review to make sure we have all the necessary info.