2020-05-30 02:56:05 +03:00
|
|
|
use thiserror::Error as DeriveError;
|
|
|
|
|
2021-01-30 18:15:47 +03:00
|
|
|
use std::{io, num, path};
|
2020-05-30 02:56:05 +03:00
|
|
|
|
|
|
|
#[derive(Debug, DeriveError)]
|
|
|
|
pub enum Error {
|
|
|
|
#[error("{0}")]
|
|
|
|
BundlerError(#[from] anyhow::Error),
|
|
|
|
#[error("`{0}`")]
|
|
|
|
GlobError(#[from] glob::GlobError),
|
|
|
|
#[error("`{0}`")]
|
|
|
|
GlobPatternError(#[from] glob::PatternError),
|
|
|
|
#[error("`{0}`")]
|
|
|
|
IoError(#[from] io::Error),
|
|
|
|
#[error("`{0}`")]
|
|
|
|
ImageError(#[from] image::ImageError),
|
|
|
|
#[error("`{0}`")]
|
|
|
|
TomlError(#[from] toml::de::Error),
|
|
|
|
#[error("`{0}`")]
|
|
|
|
WalkdirError(#[from] walkdir::Error),
|
|
|
|
#[error("`{0}`")]
|
|
|
|
StripError(#[from] path::StripPrefixError),
|
|
|
|
#[error("`{0}`")]
|
|
|
|
ConvertError(#[from] num::TryFromIntError),
|
|
|
|
#[cfg(not(target_os = "linux"))]
|
|
|
|
#[error("`{0}`")]
|
|
|
|
ZipError(#[from] zip::result::ZipError),
|
|
|
|
#[cfg(not(target_os = "linux"))]
|
|
|
|
#[error("`{0}`")]
|
|
|
|
HexError(#[from] hex::FromHexError),
|
|
|
|
#[error("`{0}`")]
|
|
|
|
HandleBarsError(#[from] handlebars::RenderError),
|
|
|
|
#[error("`{0}`")]
|
|
|
|
JsonError(#[from] serde_json::error::Error),
|
|
|
|
#[cfg(windows)]
|
|
|
|
#[error("`{0}`")]
|
|
|
|
RegexError(#[from] regex::Error),
|
|
|
|
#[cfg(windows)]
|
|
|
|
#[error("`{0}`")]
|
|
|
|
HttpError(#[from] attohttpc::Error),
|
|
|
|
#[error("hash mismatch of downloaded file")]
|
|
|
|
HashError,
|
|
|
|
#[error("Architecture Error: `{0}`")]
|
|
|
|
ArchError(String),
|
|
|
|
#[error(
|
|
|
|
"Couldn't get tauri config; please specify the TAURI_CONFIG or TAURI_DIR environment variables"
|
|
|
|
)]
|
|
|
|
EnvironmentError,
|
|
|
|
#[error("Could not find Icon paths. Please make sure they exist in the tauri config JSON file")]
|
|
|
|
IconPathError,
|
|
|
|
#[error("Path Error:`{0}`")]
|
|
|
|
PathUtilError(String),
|
|
|
|
#[error("Shell Scripting Error:`{0}`")]
|
|
|
|
ShellScriptError(String),
|
|
|
|
#[error("`{0}`")]
|
|
|
|
GenericError(String),
|
|
|
|
}
|
|
|
|
|
|
|
|
pub type Result<T> = anyhow::Result<T, Error>;
|