From 032c1592f6273e596d04768ada3fcb173d61af01 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Tue, 13 Jul 2021 15:13:36 +0100 Subject: [PATCH] errors: Provide custom Display impls for Inapplicable errors Signed-off-by: Ian Jackson --- src/error.rs | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) 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; -- 2.30.2