✨ feat(error): add custom error types for rule selection
- introduce `NoRuleSelector`, `NoRuleFoundForLabel`, and `LabelNotFoundInRules` errors - these errors provide more specific feedback when rule selection fails
This commit is contained in:
committed by
Jeremiah Russell
parent
662d08ba4f
commit
3aa76a20a8
@@ -12,6 +12,15 @@ pub enum Error {
|
|||||||
/// Expansion of home directory in `{0}` failed
|
/// Expansion of home directory in `{0}` failed
|
||||||
#[error("Expansion of home directory in `{0}` failed")]
|
#[error("Expansion of home directory in `{0}` failed")]
|
||||||
HomeExpansionFailed(String),
|
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}`
|
/// Directory creation failed for `{0}`
|
||||||
#[error("Directory creation failed for `{0:?}`")]
|
#[error("Directory creation failed for `{0:?}`")]
|
||||||
DirectoryCreationFailed((String, Box<std::io::Error>)),
|
DirectoryCreationFailed((String, Box<std::io::Error>)),
|
||||||
|
|||||||
Reference in New Issue
Block a user