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

Should exit with error status on invalid arguments #109

Open
acoulton opened this issue Aug 14, 2015 · 0 comments
Open

Should exit with error status on invalid arguments #109

acoulton opened this issue Aug 14, 2015 · 0 comments
Assignees
Labels

Comments

@acoulton
Copy link
Member

If running a task with invalid arguments, minion currently just prints the validation error to stdout and skips execution of the task, eventually terminating with an exit code of 0.

I would expect it to quit with a nonzero code in this case, since the task has failed.

There's 3 options for fixes:

  • return an exit code from Minion_Task::execute and pass it to exit in the script wrapper. This would mean modifying index.php in kohana/kohana and requiring all users to change their own projects to match.
  • throw an exception from Minion_Task::execute and assume it will be unhandled and cause php to quit with an exit code.
  • just exit from Minion_Task::execute - hard to test and generally nasty.

Returning an exit code feels cleanest, but I think throwing an exception is the most sensible bugfix at this point?

@acoulton acoulton added the bug label Aug 14, 2015
@acoulton acoulton self-assigned this Aug 14, 2015
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

1 participant