From: Ian Jackson Date: Tue, 13 Jul 2021 14:13:36 +0000 (+0100) Subject: errors: Provide custom Display impls for Inapplicable errors X-Git-Tag: otter-0.7.2~125 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=032c1592f6273e596d04768ada3fcb173d61af01;p=otter.git errors: Provide custom Display impls for Inapplicable errors Signed-off-by: Ian Jackson --- diff --git a/src/error.rs b/src/error.rs index 7b4c4cd7..8387515d 100644 --- a/src/error.rs +++ b/src/error.rs @@ -175,15 +175,14 @@ display_as_debug!{PieceOpErrorPartiallyProcessed} #[derive(Error,Debug,Serialize,Copy,Clone)] pub enum Inapplicable { - Conflict, - PosOffTable, - PieceGone, - Occultation, - PieceUnrotateable, - OcculterAlreadyRotated, - OrganisedPlacementOverfull, + #[error("simultaneous update")] Conflict, + #[error("position off table")] PosOffTable, + #[error("piece gone")] PieceGone, + #[error("prevented by occultation")] Occultation, + #[error("piece may not be rotated")] PieceUnrotateable, + #[error("occulter already rotated")] OcculterAlreadyRotated, + #[error("overfull, cannot organise")] OrganisedPlacementOverfull, } -display_as_debug!{Inapplicable} pub type StartupError = anyhow::Error;