- Prevent 'nx9-wg version' from creating data directories by avoiding database initialization. - Create parent directories when an explicit --database path is provided. - Redact printed generated administrator passwords; announce file path or redact instead. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
38 lines
951 B
Rust
38 lines
951 B
Rust
//! Error types for nx9-wg.
|
|
|
|
#[derive(Debug, thiserror::Error)]
|
|
pub enum Nx9Error {
|
|
/// Validation error
|
|
#[error("Validation error: {0}")]
|
|
Validation(String),
|
|
/// Database error
|
|
#[error("Database error: {0}")]
|
|
Database(String),
|
|
/// WireGuard error
|
|
#[error("WireGuard error: {0}")]
|
|
WireGuard(String),
|
|
/// Network error
|
|
#[error("Network error: {0}")]
|
|
Network(String),
|
|
/// Authentication error
|
|
#[error("Auth error: {0}")]
|
|
Auth(String),
|
|
/// Cryptography error
|
|
#[error("Crypto error: {0}")]
|
|
Crypto(String),
|
|
/// Backup error
|
|
#[error("Backup error: {0}")]
|
|
Backup(String),
|
|
/// Configuration error
|
|
#[error("Config error: {0}")]
|
|
Config(String),
|
|
/// I/O error
|
|
#[error("I/O error: {0}")]
|
|
Io(#[from] std::io::Error),
|
|
/// Internal error
|
|
#[error("Internal error: {0}")]
|
|
Internal(String),
|
|
}
|
|
|
|
pub type Result<T> = std::result::Result<T, Nx9Error>;
|