nushell/tests
Andrés N. Robalino c9c6bd4836
Create errors from tables. (#3986)
```
> [
  [          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.
2021-09-02 21:07:26 -05:00
..
assets/nu_json Preserve order when serializing/deserialize json by default. (#3126) 2021-03-04 01:35:13 -05:00
fixtures add performance metrics for measuring startup time (#3854) 2021-07-29 18:52:40 -05:00
plugins Remove it expansion (#2701) 2020-10-26 19:55:52 +13:00
shell Create errors from tables. (#3986) 2021-09-02 21:07:26 -05:00
main.rs Move most of the root package into a subcrate. (#1445) 2020-03-04 13:58:20 -05:00