mirror of
https://github.com/nushell/nushell.git
synced 2024-11-30 04:14:17 +01:00
c9c6bd4836
``` > [ [ msg, labels, span]; ["The message", "Helpful message here", ([[start, end]; [0, 141]])] ] | error make error: The message ┌─ shell:1:1 │ 1 │ ╭ [ 2 │ │ [ msg, labels, span]; 3 │ │ ["The message", "Helpful message here", ([[start, end]; [0, 141]])] │ ╰─────────────────────────────────────────────────────────────────────^ Helpful message here ``` Adding a more flexible approach for creating error values. One use case, for instance is the idea of a test framework. A failed assertion instead of printing to the screen it could create tables with more details of the failed assertion and pass it to this command for making a full fledge error that Nu can show. This can (and should) be extended for capturing error values as well in the pipeline. One could also use it for inspection. For example: `.... | error inspect { # inspection here }` or "error handling" as well, like so: `.... | error capture { fix here }` However, we start here only with `error make` that creates an error value for you with limited support for the time being. |
||
---|---|---|
.. | ||
environment | ||
pipeline | ||
mod.rs |