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.
Activity
jayjun commentedon Jun 17, 2020
exited with 0is definitely surprising to me. I tried and got 101 as expected.Either way, Rambo does not use Bash or any shell. It forks and executes the command directly, so there’s no
command not foundgenerated.Currently Rambo crashes by design because a wrong command should be a programming error. Would a friendlier message help?
jayjun commentedon Jun 17, 2020
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,Rambo.CommandNotFoundError.{: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.