forked from comit-network/xmr-btc-swap
-
Notifications
You must be signed in to change notification settings - Fork 47
Open
Description
ref #859
Lost/trapped Funds
No
NOT SURE IF ITS INTENTIONAL
Describe the bug
The asb-controller CLI always exits with code 0 even when commands fail, breaking shell scripts and automation that rely on exit codes.
Location: in main.rs line ~ 14 to 21
match cli.cmd {
None => repl::run(client, dispatch).await?,
Some(cmd) => {
if let Err(e) = dispatch(cmd.clone(), client.clone()).await {
eprintln!("Command failed with error: {e:?}");
// Error printed but not propagated - exits 0
}
}
}
Ok(()) // Always returns Ok(())Reproduction:
$ ./target/release/asb-controller --url http://127.0.0.1:1 check-connection
Command failed with error: client error (Connect)
...
$ echo $?
0 # Should be non-zeroFix: maybe return the error instead of swallowing it:
Some(cmd) => {
dispatch(cmd.clone(), client.clone()).await?; // Propagate error
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels