def METHOD_NAME(self):
    while not self.finished():
        time.sleep(self._timeout)
        self._update_status()
    if self.operation_status not in get_succeeded_run_status(self._cmd):
        from knack.util import CLIError
        raise CLIError("The run with ID '{}' finished with unsuccessful status '{}'. "
                       "Show run details by 'az acr task show-run -r {} --run-id {}'. "
                       "Show run logs by 'az acr task logs -r {} --run-id {}'.".format(
                           self._run_id,
                           self.operation_status,
                           self._registry_name,
                           self._run_id,
                           self._registry_name,
                           self._run_id
                       ))