perfectsense / gyro

Gyro is a command-line tool for creating, updating, and maintaining cloud infrastructure. Gyro makes infrastructure-as-code possible.
https://gyro.dev
Apache License 2.0
134 stars 7 forks source link

Gyro CLI always exits with '0' even if there's an error. #335

Open sshyub opened 3 years ago

sshyub commented 3 years ago

Describe the bug Gyro CLI always exits with '0' even if there's an error.

To Reproduce Give a wrong credential file in init.gyro, and run gyro up.

Expected behavior Gyro exited with '1' previously.

Additional context After gyro cli refactored with picocli, exception is handled by commandLine.setExecutionExceptionHandler(Gyro::invalidUserInput); in Gyro#init(), which always returns the status code, 2, but then it is even suppressed by Gyro#run().

Fixes should match the exit codes that are declared in the catch clauses in Gyro#main() function. Also the catch clauses in main should be removed if they are not used any more.