Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Padrino Command Exits Zero on Error #1849

Closed
sshaw opened this issue Dec 21, 2014 · 1 comment
Closed

Padrino Command Exits Zero on Error #1849

sshaw opened this issue Dec 21, 2014 · 1 comment
Assignees
Labels

Comments

@sshaw
Copy link
Contributor

sshaw commented Dec 21, 2014

Ran into a problem doing something like this:

/tmp/padrino-test >padrino stop && echo 'Success!'
=> tmp/pids/server.pid not found!
Success!

As you can see, padrino s wasn't running, yet it the command exited with 0.

This is also the case when trying to exec invalid commands:

/tmp/padrino-test >padrino whatwhatwhat && echo 'Success!'
Could not find command "whatwhatwhat".
Success!

Of course this is (to some extent) a Thor issue.

The second problem can be easily solved by adding the following to Padrino::Cli::Launcher:

protected
def exit_on_failure?
  true
end

Of course this assumes you don't want to maintain any sort of dependency on the current behavior.

Fixing the first problem seems a tad ugly and/or invasive:

  1. Explicitly call exit 1 on failure
  2. Raise Thor::Error on failures like the above and stuff like this
  3. Just let errors propagate, you'll get non-zero but with a stacktrack -which is not too user friendly
@ujifgc ujifgc self-assigned this Jan 10, 2015
@ujifgc ujifgc added the bug label Jan 10, 2015
@ujifgc ujifgc closed this as completed in 1a87418 Jan 10, 2015
@ujifgc
Copy link
Member

ujifgc commented Jan 10, 2015

Thank you for your report! Please tell if there's more commands failing to convey their failure.

ujifgc added a commit that referenced this issue Sep 8, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants