2022-02-14 03:22:51 +01:00
|
|
|
---
|
|
|
|
title: error make
|
|
|
|
layout: command
|
|
|
|
version: 0.59.0
|
|
|
|
---
|
|
|
|
|
|
|
|
Create an error.
|
|
|
|
|
|
|
|
## Signature
|
|
|
|
|
2022-02-20 02:13:33 +01:00
|
|
|
```> error make (error_struct)```
|
2022-02-14 03:22:51 +01:00
|
|
|
|
|
|
|
## Parameters
|
|
|
|
|
2022-02-20 02:13:33 +01:00
|
|
|
- `error_struct`: the error to create
|
2022-02-14 03:22:51 +01:00
|
|
|
|
|
|
|
## Examples
|
|
|
|
|
|
|
|
Create a custom error for a custom command
|
|
|
|
```shell
|
|
|
|
> def foo [x] {
|
|
|
|
let span = (metadata $x).span;
|
2022-02-21 14:38:15 +01:00
|
|
|
error make {msg: "this is fishy", label: {text: "fish right here", start: $span.start, end: $span.end } }
|
2022-02-14 03:22:51 +01:00
|
|
|
}
|
|
|
|
```
|