Skip to content

Commit

Permalink
Fixes #38253 - Send error via json so it is propagated to Hammer
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremylenz committed Feb 28, 2025
1 parent 83498c4 commit f3444e8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ def set_content_view_environments
handle_errors(labels: cve_params[:content_view_environments],
ids: cve_params[:content_view_environment_ids])
end
rescue Katello::Errors::MultiEnvironmentNotSupportedError => e
handle_multicv_not_enabled(e)
end

def cve_params
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ def handle_errors(labels: [], ids: [])
:with_logging => true
)
end

def handle_multicv_not_enabled(e)

Check failure on line 23 in app/controllers/katello/concerns/api/v2/multi_cv_params_handling.rb

View workflow job for this annotation

GitHub Actions / Rubocop / Rubocop

Naming/MethodParameterName: Method parameter must be at least 3 characters long.
render :json => { :error => { :message => e.message }}, :status => :bad_request
end
end
end
end

0 comments on commit f3444e8

Please sign in to comment.