You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
exited with 0 is definitely surprising to me. I tried and got 101 as expected.
iex(1)>Rambo.run("incorrect_command",log: true)thread'main'panickedat'failed to spawn child: Os { code: 2, kind: NotFound, message: "No such file or directory" }',src/main.rs:203:21note: runwith `RUST_BACKTRACE=1` environmentvariabletodisplayabacktrace{:error,"rambo exited with 101"}
Either way, Rambo does not use Bash or any shell. It forks and executes the command directly, so there’s no command not found generated.
Currently Rambo crashes by design because a wrong command should be a programming error. Would a friendlier message help?
To clarify, the Rambo shim crashes by design but Rambo inside Elixir still returns gracefully with {:error, "rambo exited with 101"}. So two other options are,
Crash inside Elixir too with Rambo.CommandNotFoundError.
Return with a better error message like {:error, "rambo: command not found"}.
Adding Rambo.run! to support both does not seem right. A wrong command should be fatal and surfaced as soon as possible, so I’m leaning to option 1.
I'm trying out Rambo to monitor long-running Ruby processes. Thank you for your work!
If I run something like:
I will get
{:error, "rambo exited with 0"}
as the output.But if I run this from the command line, instead I will get
-bash: incorrect_command: command not found
.I found the error message somewhat surprising (even if I understand where it comes from).
Should it instead capture & return the output of bash?
Thanks!
The text was updated successfully, but these errors were encountered: