use thiserror::Error; pub type Result = std::result::Result; pub type GameResult = std::result::Result; #[derive(Debug, Error)] pub enum Error { #[error("GameError")] GameError { #[from] source: GameError, }, #[error(transparent)] Other { #[from] source: anyhow::Error, }, } #[derive(Debug, Clone, Error)] pub enum GameError { #[error("The guess has the wrong length")] GuessHasWrongLength, #[error("The game is finished but a guess is being made")] TryingToPlayAFinishedGame, }