harmony/opnsense-config/src/error.rs

20 lines
509 B
Rust

use thiserror::Error;
#[derive(Error, Debug)]
pub enum Error {
#[error("XML error: {0}")]
Xml(String),
#[error("SSH error: {0}")]
Ssh(#[from] russh::Error),
#[error("SSH Client error: {0}")]
SftpClient(#[from] russh_sftp::client::error::Error),
#[error("Command failed : {0}")]
Command(String),
#[error("I/O error: {0}")]
Io(#[from] std::io::Error),
#[error("Config error: {0}")]
Config(String),
#[error("Unexpected error: {0}")]
Unexpected(String),
}