diff --git a/CHANGES/464.bugfix b/CHANGES/464.bugfix new file mode 100644 index 000000000..2f82a82f0 --- /dev/null +++ b/CHANGES/464.bugfix @@ -0,0 +1 @@ +Fixed a bug in reporting the failure of a task if the reason was not an exception in the task code. diff --git a/pulpcore/cli/common/context.py b/pulpcore/cli/common/context.py index 699e00b55..ecd719547 100644 --- a/pulpcore/cli/common/context.py +++ b/pulpcore/cli/common/context.py @@ -183,7 +183,8 @@ def _check_task_finished(task: EntityDefinition) -> bool: elif task["state"] == "failed": raise click.ClickException( _("Task {task_href} failed: '{description}'").format( - task_href=task_href, description=task["error"]["description"] + task_href=task_href, + description=task["error"].get("description") or task["error"].get("reason"), ) ) elif task["state"] == "canceled":