mirror of
https://github.com/nushell/nushell.git
synced 2025-08-09 12:35:59 +02:00
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:
@ -13,7 +13,7 @@ nu-ansi-term = "0.42.0"
|
||||
|
||||
nu-color-config = { path = "../nu-color-config" }
|
||||
|
||||
miette = { version = "3.0.0", features = ["fancy"] }
|
||||
miette = { version = "4.1.0", features = ["fancy"] }
|
||||
thiserror = "1.0.29"
|
||||
reedline = { git = "https://github.com/nushell/reedline", branch = "main" }
|
||||
|
||||
|
@ -41,6 +41,14 @@ impl<'src> miette::Diagnostic for CliError<'src> {
|
||||
|
||||
// Finally, we redirect the source_code method to our own source.
|
||||
fn source_code(&self) -> Option<&dyn SourceCode> {
|
||||
Some(&self.1)
|
||||
if let Some(source_code) = self.0.source_code() {
|
||||
Some(source_code)
|
||||
} else {
|
||||
Some(&self.1)
|
||||
}
|
||||
}
|
||||
|
||||
fn related<'a>(&'a self) -> Option<Box<dyn Iterator<Item = &'a dyn miette::Diagnostic> + 'a>> {
|
||||
self.0.related()
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user