Skip to content

Commit

Permalink
Update creating_errors.md (#1154)
Browse files Browse the repository at this point in the history
Updated span, removed start and end(deprecated)
  • Loading branch information
Ktoks authored Nov 23, 2023
1 parent eb28ebb commit c9756c5
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions book/creating_errors.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ let span = (metadata $x).span;
Next, you can create an error using the [`error make`](/commands/docs/error_make.md) command. This command takes in a record that describes the error to create:

```nu
error make {msg: "this is fishy", label: {text: "fish right here", start: $span.start, end: $span.end } }
error make {msg: "this is fishy", label: {text: "fish right here", span: $span } }
```

Together with your custom command, it might look like this:
Expand All @@ -28,8 +28,7 @@ def my-command [x] {
msg: "this is fishy",
label: {
text: "fish right here",
start: $span.start,
end: $span.end
span: (metadata $x).span
}
}
}
Expand Down

0 comments on commit c9756c5

Please sign in to comment.