1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
use thiserror::Error;

#[derive(Error, Debug, PartialEq, Eq)]
pub enum MoveError {
    #[error("Illegal king side castle")]
    IllegalKingSideCastle,

    #[error("Illegal queen side castle")]
    IllegalQueenSideCastle,

    #[error("Illegal capture")]
    IllegalCapture,

    #[error("Unknown piece")]
    UnknownPiece,

    #[error("Ambiguous move notation")]
    AmbiguousMoveNotation,

    #[error("Can't find piece to move")]
    InvalidPieceToMove,

    #[error("Invalid promotion")]
    InvalidPromotion,
}