mirror of
https://github.com/nushell/nushell.git
synced 2025-08-10 05:18:27 +02:00
Refactor error make
(#10923)
- Replaced `start`/`end` with span. - Fixed standard library. - Add `help` option. - Add a couple more errors for invalid record types. Resolve #10914 # Description # User-Facing Changes - **BREAKING CHANGE:** `error make` now takes in `span` instead of `start`/`end`: ```Nushell error make { msg: "Message" label: { text: "Label text" span: (metadata $var).span } } ``` - `error make` now has a `help` argument for custom error help.
This commit is contained in:
@ -94,8 +94,7 @@ def throw-error [error: record] {
|
||||
msg: $"(ansi red)($error.msg)(ansi reset)"
|
||||
label: {
|
||||
text: ($error.label)
|
||||
start: $error.span.start
|
||||
end: $error.span.end
|
||||
span: $error.span
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user