use std::result;
use thiserror::Error;
use crate::client::errors::ClientApiError;
pub type LicenseResult<T> = result::Result<T, LicenseError>;
#[derive(Debug, Error)]
pub enum LicenseError {
#[error("server error: {0}")]
ServerError(String),
#[error("license invalid: {0}")]
InvalidLicense(String),
#[error("network error: {0}")]
NetworkError(#[from] reqwest::Error),
#[error("storage error: {0}")]
StorageError(#[from] std::io::Error),
#[error("encryption error: {0}")]
EncryptionError(String),
#[error("decryption error: {0}")]
DecryptionError(String),
#[error("keyring error: {0}")]
KeyringError(String),
#[error("config error: {0}")]
ConfigError(String),
#[error("api error: {0}")]
ClientApiError(ClientApiError),
#[error("unknown error")]
UnknownError,
}