Skip to content

Extract displayMessage from validation errors - #666

Open
Odilhao wants to merge 1 commit into
theforeman:3.18-stablefrom
Odilhao:display-message-validation-errors
Open

Odilhao wants to merge 1 commit into
theforeman:3.18-stablefrom
Odilhao:display-message-validation-errors

Conversation

@Odilhao

@Odilhao Odilhao commented Oct 20, 2026

Copy link
Copy Markdown
Member

Backports the displayMessage handling change from upstream PR #655. When a 422 response includes displayMessage, preserve the detailed validation error in the CLI output.

When the Foreman/Katello API returns validation errors (422 status),
it includes detailed error messages in the 'displayMessage' field.
The exception handler was only checking 'message' and 'full_messages',
causing detailed error information to be lost.

This commit updates handle_unprocessable_entity to check for
'displayMessage' first, matching the behavior of handle_foreman_error
which already handles this field correctly.

Before:
  Could not update the host

After:
  Could not update the host:
    Validation failed: Host example.com: Cannot add content view
    environment to content facet. The host's content source does
    not sync lifecycle environment 'Library'.
(cherry picked from commit 4aab7ea)

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

2 participants