=> Status::NotFound,
OE::PieceHeld | OE::PieceImmoveable |
OE::OverlappingOccultation | OE::Occultation |
- OE::BadPieceStateForOperation
- => Status::Conflict,
BadOperation | BadJSON(_)
=> Status::BadRequest,
}
},
"reset" => {
if state.current.is_some() {
- throw!(OE::BadPieceStateForOperation);
+ throw!(Ia::BadPieceStateForOperation);
}
state.reset(&self.spec);
(Unpredictable, format!("reset"))
"claim-x" | "claim-y" => {
let user = get_user();
if let Some(_gpl) = gs.players.get(state.users[user].player) {
- throw!(OE::BadPieceStateForOperation);
+ throw!(Ia::BadPieceStateForOperation);
}
state.users[user].player = player;
if state.users[! user].player == player {
(Unpredictable, format!("cleared player {} at the", user))
},
_ => {
- throw!(OE::BadPieceStateForOperation);
+ throw!(Ia::BadPieceStateForOperation);
}
};
OverlappingOccultation, // xxx should be _inapplicable_
#[error("piece is occulting, or occulted")]
Occultation, // xxx should be _inapplicable_
- #[error("UI operation not valid in the curret piece state")]
- BadPieceStateForOperation, // xxx should be _inapplicable_
}
#[derive(Error,Debug)]
#[error("piece may not be moved")] PieceImmoveable,
#[error("occulter already rotated")] OcculterAlreadyRotated,
#[error("overfull, cannot organise")] OrganisedPlacementOverfull,
+ #[error("UI operation not valid in the curret piece state")]
+ BadPieceStateForOperation,
}
pub type StartupError = anyhow::Error;