generated from PlexSheep/rs-base
27 lines
584 B
Rust
27 lines
584 B
Rust
|
use thiserror::Error;
|
||
|
|
||
|
pub type Result<T> = std::result::Result<T, Error>;
|
||
|
pub type GameResult<T> = std::result::Result<T, GameError>;
|
||
|
|
||
|
#[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,
|
||
|
}
|