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

Throw a CalledProcessError not a ErrorException when run gives a nonzero exit status #26023

Closed
oxinabox opened this issue Feb 13, 2018 · 3 comments
Labels
error handling Handling of exceptions by Julia or the user

Comments

@oxinabox
Copy link
Contributor

oxinabox commented Feb 13, 2018

When running a command returns a non-zero exit status,
currently the error function is called, which throws an ErrorException:

error("failed process: ", proc, " [", proc.exitcode, "]")

That is not great. It is not a very nice exception to catch since the type doesn't tell us anything about the cause.

I am of the belief that error should not be being uses in Base/stdlib or indeed even in packages (past the prototyping stage).
It is a convenience to users, and should be used in hacky little scripts,
without error handling, where to error means to crash out.

Lets throw a real error.
Python uses CalledProcessError.
That is as good a name as any.

@ararslan ararslan added the error handling Handling of exceptions by Julia or the user label Feb 13, 2018
@samoconnor
Copy link
Contributor

🚲🏚: SubprocessError

@StefanKarpinski
Copy link
Member

SubprocessError is a good name. +1

@oxinabox
Copy link
Contributor Author

I closed this in #27900

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
error handling Handling of exceptions by Julia or the user
Projects
None yet
Development

No branches or pull requests

4 participants