refactor log_and_ignore_error