commit 852e9192220c8fc834a80fe3ed9653bbf4908e76
parent f44a17e74091ce8fdd42f2be507a046c51623844
Author: Antoine A <>
Date: Sun, 28 Dec 2025 21:27:54 +0100
cyclos: improve setup
Diffstat:
1 file changed, 12 insertions(+), 7 deletions(-)
diff --git a/taler-cyclos/src/setup.rs b/taler-cyclos/src/setup.rs
@@ -85,15 +85,15 @@ pub async fn setup(cfg: &Config, _reset: bool, client: &reqwest::Client) -> anyh
};
let currency = if let Some(id) = cfg.account_type_id {
if let Some(p) = accounts.iter().find(|it| it.ty.id == id) {
- debug!(target: "setup", "config ACCOUNT_TYPE_ID {id} one of:{accounts_fmt}");
+ debug!(target: "setup", "ACCOUNT_TYPE_ID {id} in config is one of:{accounts_fmt}");
Some(&p.currency)
} else {
- error!(target: "setup", "got unknown ACCOUNT_TYPE_ID {id} in config, expected one of:{accounts_fmt}");
+ error!(target: "setup", "Unknown ACCOUNT_TYPE_ID {id} in config, must be one of:{accounts_fmt}");
ready = false;
None
}
} else {
- error!(target: "setup", "no ACCOUNT_TYPE_ID in config, must be one of:{accounts_fmt}");
+ error!(target: "setup", "Missing ACCOUNT_TYPE_ID in config, must be one of:{accounts_fmt}");
ready = false;
None
};
@@ -113,7 +113,12 @@ pub async fn setup(cfg: &Config, _reset: bool, client: &reqwest::Client) -> anyh
let mut s = String::new();
for p in &data.payment_types {
if p.currency.ty.id == currency.ty.id {
- write!(&mut s, "\n{} {} {}", p.ty.id, p.currency.ty.name, p.ty.name).unwrap();
+ write!(
+ &mut s,
+ "\n{} '{}' in {}",
+ p.ty.id, p.ty.name, p.currency.ty.name
+ )
+ .unwrap();
}
}
s
@@ -121,17 +126,17 @@ pub async fn setup(cfg: &Config, _reset: bool, client: &reqwest::Client) -> anyh
if let Some(id) = cfg.payment_type_id {
if let Some(p) = data.payment_types.iter().find(|it| it.ty.id == id) {
if p.currency.ty.id != currency.ty.id {
- error!(target: "setup", "PAYMENT_TYPE_ID {} in config use currency {} expected {}, should be one of:{payment_fmt}", p.ty.id, p.currency.ty.name, currency.ty.name);
+ error!(target: "setup", "PAYMENT_TYPE_ID {} in config use currency {} expected {}, must be one of:{payment_fmt}", p.ty.id, p.currency.ty.name, currency.ty.name);
ready = false
} else {
debug!(target: "setup", "PAYMENT_TYPE_ID {id} config is one of:{payment_fmt}");
}
} else {
- error!(target: "setup", "unknown PAYMENT_TYPE_ID {id} in config, should be one of:{payment_fmt}");
+ error!(target: "setup", "Unknown PAYMENT_TYPE_ID {id} in config, must be one of:{payment_fmt}");
ready = false;
}
} else {
- error!(target: "setup", "no PAYMENT_TYPE_ID in config, must be one of:{payment_fmt}");
+ error!(target: "setup", "Missing PAYMENT_TYPE_ID in config, must be one of:{payment_fmt}");
ready = false;
}
}