exit with non-zero exit code when an exception occurs