use error_or_failed to determine exit code.