Throw a CalledProcessError
not a ErrorException
when run
gives a nonzero exit status
#26023
Labels
error handling
Handling of exceptions by Julia or the user
When running a command returns a non-zero exit status,
currently the
error
function is called, which throws anErrorException
:julia/base/process.jl
Line 693 in f9f11a3
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.
The text was updated successfully, but these errors were encountered: