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

@ -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(