more strict nuon handling, better nuon errors (#4576)

* more strict nuon handling, better nuon errors

* Improve errors a bit more
This commit is contained in:
JT
2022-02-20 22:31:50 -05:00
committed by GitHub
parent 5befa6f80a
commit a96f8b891e
9 changed files with 485 additions and 86 deletions

View File

@ -7,7 +7,7 @@ edition = "2021"
[dependencies]
thiserror = "1.0.29"
miette = "3.0.0"
miette = "4.1.0"
serde = {version = "1.0.130", features = ["derive"]}
chrono = { version="0.4.19", features=["serde"] }
indexmap = { version="1.7", features=["serde-1"] }

View File

@ -268,10 +268,23 @@ pub enum ShellError {
#[diagnostic(help("{3}"))]
SpannedLabeledErrorHelp(String, String, #[label("{1}")] Span, String),
#[error("{0}")]
#[diagnostic()]
SpannedLabeledErrorRelated(
String,
String,
#[label("{1}")] Span,
#[related] Vec<ShellError>,
),
#[error("{0}")]
#[diagnostic(help("{1}"))]
LabeledError(String, String),
#[error("{1}")]
#[diagnostic()]
OutsideSpannedLabeledError(#[source_code] String, String, String, #[label("{2}")] Span),
#[error("Deprecated command {0}")]
#[diagnostic(code(nu::shell::deprecated_command), url(docsrs))]
DeprecatedCommand(