From c9756c5cfcf5bbdb6520cf29b374b39cec2137e0 Mon Sep 17 00:00:00 2001 From: Ktoks <36412717+Ktoks@users.noreply.github.com> Date: Thu, 23 Nov 2023 15:08:38 -0700 Subject: [PATCH] Update creating_errors.md (#1154) Updated span, removed start and end(deprecated) --- book/creating_errors.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/book/creating_errors.md b/book/creating_errors.md index 1f63dbe1e17..4a1be7d4bbd 100644 --- a/book/creating_errors.md +++ b/book/creating_errors.md @@ -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: @@ -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 } } }