Skip to content

Extract displayMessage from validation errors - #666

Merged
Odilhao merged 1 commit into
theforeman:3.18-stablefrom
Odilhao:display-message-validation-errors
Oct 23, 2026
Merged

Odilhao merged 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)
@Odilhao
Odilhao merged commit c8f3695 into theforeman:3.18-stable Oct 23, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants