|
|
@ -16,6 +16,7 @@ pub type Result<T> = std::result::Result<T, Error>;
|
|
|
|
|
|
|
|
|
|
|
|
#[derive(Debug, Error, Diagnostic)]
|
|
|
|
#[derive(Debug, Error, Diagnostic)]
|
|
|
|
pub enum Error {
|
|
|
|
pub enum Error {
|
|
|
|
|
|
|
|
#[diagnostic(code(nenv::web))]
|
|
|
|
#[error("Failed to call nodejs.com api.")]
|
|
|
|
#[error("Failed to call nodejs.com api.")]
|
|
|
|
Web(
|
|
|
|
Web(
|
|
|
|
#[from]
|
|
|
|
#[from]
|
|
|
@ -24,6 +25,7 @@ pub enum Error {
|
|
|
|
ApiError,
|
|
|
|
ApiError,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#[diagnostic(code(nenv::extract))]
|
|
|
|
#[error("The node archive could not be extracted")]
|
|
|
|
#[error("The node archive could not be extracted")]
|
|
|
|
Extract(
|
|
|
|
Extract(
|
|
|
|
#[from]
|
|
|
|
#[from]
|
|
|
@ -32,14 +34,15 @@ pub enum Error {
|
|
|
|
ExtractError,
|
|
|
|
ExtractError,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#[diagnostic(code(nenv::config))]
|
|
|
|
#[error("The config file could not be loaded")]
|
|
|
|
#[error("The config file could not be loaded")]
|
|
|
|
Config(
|
|
|
|
Config(
|
|
|
|
#[from]
|
|
|
|
#[from]
|
|
|
|
#[source]
|
|
|
|
|
|
|
|
#[diagnostic_source]
|
|
|
|
#[diagnostic_source]
|
|
|
|
ConfigError,
|
|
|
|
ConfigError,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#[diagnostic(code(nenv::mapper))]
|
|
|
|
#[error("Mapping failed")]
|
|
|
|
#[error("Mapping failed")]
|
|
|
|
Mapper(
|
|
|
|
Mapper(
|
|
|
|
#[from]
|
|
|
|
#[from]
|
|
|
@ -48,6 +51,7 @@ pub enum Error {
|
|
|
|
MapperError,
|
|
|
|
MapperError,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#[diagnostic(code(nenv::version))]
|
|
|
|
#[error("The passed version is invalid")]
|
|
|
|
#[error("The passed version is invalid")]
|
|
|
|
Version(
|
|
|
|
Version(
|
|
|
|
#[from]
|
|
|
|
#[from]
|
|
|
@ -55,9 +59,11 @@ pub enum Error {
|
|
|
|
VersionError,
|
|
|
|
VersionError,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#[diagnostic(code(nenv::json))]
|
|
|
|
#[error("Failed to work with json")]
|
|
|
|
#[error("Failed to work with json")]
|
|
|
|
Json(#[from] serde_json::Error),
|
|
|
|
Json(#[from] serde_json::Error),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#[diagnostic(code(nenv::io))]
|
|
|
|
#[error("Error during IO operation")]
|
|
|
|
#[error("Error during IO operation")]
|
|
|
|
Io(#[from] io::Error),
|
|
|
|
Io(#[from] io::Error),
|
|
|
|
}
|
|
|
|
}
|
|
|
|