clean up and simplify the unhandled error code (removed _log_exception and _log_failure)