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.
nenv/src/error.rs

44 lines
865 B
Rust

use std::io;
use miette::Diagnostic;
2 years ago
use thiserror::Error;
use crate::{
repository::{config::ConfigError, extract::ExtractError},
web_api::error::ApiError,
};
2 years ago
pub(crate) type LibResult<T> = Result<T>;
pub(crate) type LibError = Error;
pub type Result<T> = std::result::Result<T, Error>;
#[derive(Debug, Error, Diagnostic)]
pub enum Error {
#[error("Failed to call nodejs.com api: {0}")]
Web(
#[from]
#[source]
#[diagnostic_source]
ApiError,
),
#[error("Failed to extract archive: {0}")]
Extract(
#[from]
#[source]
#[diagnostic_source]
ExtractError,
),
#[error("Failed to load config file: {0}")]
Config(
#[from]
#[source]
#[diagnostic_source]
ConfigError,
),
#[error("IO Error: {0}")]
Io(#[from] io::Error),
}