NoClient | NoPlayer(_) | GameBeingDestroyed
=> Status::NotFound,
OE::PieceHeld | OE::PieceGone |
- OE::OverlappingOccultation | OE::Occultation
+ OE::OverlappingOccultation | OE::Occultation |
+ OE::BadPieceStateForOperation
=> Status::Conflict,
InvalidZCoord | BadOperation | BadJSON(_)
=> Status::BadRequest,
},
"reset" => {
if state.current.is_some() {
- throw!(OE::BadOperation);
+ throw!(OE::BadPieceStateForOperation);
}
for ust in &mut state.users {
ust.remaining = self.spec.initial_time();
"claim-x" | "claim-y" => {
let user = get_user();
if let Some(_gpl) = gs.players.get(state.users[user].player) {
- throw!(OE::BadOperation);
+ throw!(OE::BadPieceStateForOperation);
}
state.users[user].player = player;
},
"unclaim-x" | "unclaim-y" => {
let user = get_user();
if state.users[user].player != player {
- throw!(OE::BadOperation);
+ throw!(OE::BadPieceStateForOperation);
}
state.users[user].player = default();
},
_ => {
- throw!(OE::BadOperation);
+ throw!(OE::BadPieceStateForOperation);
}
}
OverlappingOccultation,
#[error("piece is occulting, or occulted")]
Occultation,
+ #[error("UI operation not valid in the curret piece state")]
+ BadPieceStateForOperation,
}
from_instance_lock_error!{OnlineError}