Sha256: 8d3ea4762f8ba0d924ff5b8c297ba2d041e89852320638a7b7d5b3a795efe467

Contents?: true

Size: 762 Bytes

Versions: 7

Compression:

Stored size: 762 Bytes

Contents

module Katello
  module Concerns
    module Api::V2::MultiCVParamsHandling
      extend ActiveSupport::Concern
      include ::Katello::Api::V2::ErrorHandling

      def handle_errors(labels: [], ids: [])
        if labels.present?
          fail HttpErrors::UnprocessableEntity, "No content view environments found with names: #{labels.join(',')}"
        elsif ids.present?
          fail HttpErrors::UnprocessableEntity, "No content view environments found with ids: #{ids}"
        end
      rescue HttpErrors::UnprocessableEntity => e
        respond_for_exception(
          e,
          :status => :unprocessable_entity,
          :text => e.message,
          :errors => [e.message],
          :with_logging => true
        )
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
katello-4.16.0 app/controllers/katello/concerns/api/v2/multi_cv_params_handling.rb
katello-4.15.1 app/controllers/katello/concerns/api/v2/multi_cv_params_handling.rb
katello-4.16.0.rc2 app/controllers/katello/concerns/api/v2/multi_cv_params_handling.rb
katello-4.16.0.rc1 app/controllers/katello/concerns/api/v2/multi_cv_params_handling.rb
katello-4.15.0 app/controllers/katello/concerns/api/v2/multi_cv_params_handling.rb
katello-4.15.0.rc2 app/controllers/katello/concerns/api/v2/multi_cv_params_handling.rb
katello-4.15.0.rc1 app/controllers/katello/concerns/api/v2/multi_cv_params_handling.rb