use std::io;
use thiserror::Error as ThisError;
#[derive(ThisError, Debug)]
pub enum Error {
#[error("The `{0}` file does not exist, maybe you aren't running this code on Toolforge?")]
NotToolforge(String),
#[error("Unable to read replica.my.cnf")]
CantReadMyCnf(#[from] io::Error),
#[error("Unable to parse replica.my.cnf")]
CantParseMyCnf(#[from] ini::ParseError),
#[cfg(feature = "wikipool")]
#[error("MySQL error: {0}")]
MysqlError(#[from] mysql_async::Error),
#[cfg(feature = "wikipool")]
#[error("Unknown database: {0}")]
UnknownDatabase(String),
#[cfg(feature = "wikipool")]
#[error("Unknown domain: {0}")]
UnknownDomain(String),
}