feat: Improve exit codes and make them more specific

Signed-off-by: Awiteb <a@4rs.nl>
This commit is contained in:
Awiteb
2025-07-04 10:49:45 +00:00
parent 05b4ae30f7
commit 3510b59fbb
4 changed files with 46 additions and 7 deletions

View File

@@ -89,7 +89,9 @@ impl RelayOrSet {
match self {
Self::Relay(relay) => Ok(vec![relay]),
Self::Set(name) => {
let set = sets.get_set(&name)?;
let set = sets
.get_set(&name)
.map_err(|_| N34Error::InvalidRelaysArg(name.clone()))?;
if set.relays.is_empty() {
Err(N34Error::EmptySetRelays(name))
} else {