You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
embed-nu/src/error.rs

21 lines
500 B
Rust

use miette::Diagnostic;
use nu_protocol::{ParseError, ShellError};
use thiserror::Error;
pub type CrateResult<T> = std::result::Result<T, CrateError>;
#[derive(Clone, Debug, Error, Diagnostic)]
pub enum CrateError {
#[error("Shell Error {0}")]
#[diagnostic()]
NuShellError(#[from] ShellError),
#[error("Parse Error {0:?}")]
#[diagnostic()]
NuParseErrors(Vec<ParseError>),
#[error("Could not find the function {0}")]
#[diagnostic()]
FunctionNotFound(String),
}