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-zero
Fix: maybe return the error instead of swallowing it:
Some(cmd) => {
dispatch(cmd.clone(), client.clone()).await?; // Propagate error
}
ref #859
Lost/trapped Funds
No
NOT SURE IF ITS INTENTIONAL
Describe the bug
The
asb-controllerCLI always exits with code 0 even when commands fail, breaking shell scripts and automation that rely on exit codes.Location: in
main.rsline ~ 14 to 21Reproduction:
Fix: maybe return the error instead of swallowing it: