Add really paranoid exception handling for log_rest.