From 3aa76a20a80cbc22abfbd3beb8752bd619bad84d Mon Sep 17 00:00:00 2001 From: Jeremiah Russell Date: Wed, 8 Oct 2025 16:14:48 +0100 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20feat(error):=20add=20custom=20error?= =?UTF-8?q?=20types=20for=20rule=20selection?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - introduce `NoRuleSelector`, `NoRuleFoundForLabel`, and `LabelNotFoundInRules` errors - these errors provide more specific feedback when rule selection fails --- src/error.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/error.rs b/src/error.rs index b964ac4..ae82dca 100644 --- a/src/error.rs +++ b/src/error.rs @@ -12,6 +12,15 @@ pub enum Error { /// Expansion of home directory in `{0}` failed #[error("Expansion of home directory in `{0}` failed")] HomeExpansionFailed(String), + /// No rule selector specified (e.g. --label) + #[error("No rule selector specified (e.g. --label)")] + NoRuleSelector, + /// No rule for label + #[error("No rule for label {0}")] + NoRuleFoundForLabel(String), + /// Label not found in the rule set + #[error("Label not found in the rule set")] + LabelNotFoundInRules, /// Directory creation failed for `{0}` #[error("Directory creation failed for `{0:?}`")] DirectoryCreationFailed((String, Box)),