Add error code and help

pull/3/head
trivernis 1 year ago
parent 916dfa0f8d
commit 5eae7422af
Signed by: Trivernis
GPG Key ID: DFFFCC2C7A02DB45

@ -22,7 +22,7 @@ impl Diagnostic for CrateError {
match self { match self {
CrateError::NuShellError(n) => n.code(), CrateError::NuShellError(n) => n.code(),
CrateError::NuParseError(n) => n.code(), CrateError::NuParseError(n) => n.code(),
_ => None, Self::FunctionNotFound(_) => Some(Box::new("embed_nu::fn_not_found")),
} }
} }
@ -38,7 +38,9 @@ impl Diagnostic for CrateError {
match self { match self {
CrateError::NuShellError(n) => n.help(), CrateError::NuShellError(n) => n.help(),
CrateError::NuParseError(n) => n.help(), CrateError::NuParseError(n) => n.help(),
_ => None, CrateError::FunctionNotFound(_) => Some(Box::new(
"Make sure the function you want to execute is defined at this point.",
)),
} }
} }

Loading…
Cancel
Save