Return exit code rather than raising an exception