Sha256: 5ba4bcd1181ce4bb01ad05080aae8a924abc195eb8d1a01c41edd57449cba698

Contents?: true

Size: 768 Bytes

Versions: 13

Compression:

Stored size: 768 Bytes

Contents

module Katello
  class ErrorsController < Katello::ApplicationController
    skip_before_filter :require_user, :require_org
    skip_before_filter :authorize # ok - is used by warden

    # handles unknown routes from both / and /api namespaces
    def routing
      path = params['a']
      ex = HttpErrors::NotFound.new(_("Route does not exist:") + " #{path}")

      if path.match('/api/')
        # custom message which will render in JSON
        logger.error ex.message
        respond_to do |format|
          format.json { render :json => {:displayMessage => ex.message, :errors => [ex.message]}, :status => 404 }
          format.all { render :text => "#{ex.message}", :status => 404 }
        end
      else
        render_404 ex
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
katello-3.1.0.1 app/controllers/katello/errors_controller.rb
katello-3.1.0 app/controllers/katello/errors_controller.rb
katello-3.1.0.rc2.1 app/controllers/katello/errors_controller.rb
katello-3.0.2 app/controllers/katello/errors_controller.rb
katello-3.1.0.rc1 app/controllers/katello/errors_controller.rb
katello-3.0.1 app/controllers/katello/errors_controller.rb
katello-3.0.0 app/controllers/katello/errors_controller.rb
katello-3.0.0.rc7 app/controllers/katello/errors_controller.rb
katello-3.0.0.rc5 app/controllers/katello/errors_controller.rb
katello-3.0.0.rc4 app/controllers/katello/errors_controller.rb
katello-3.0.0.rc3 app/controllers/katello/errors_controller.rb
katello-3.0.0.rc2 app/controllers/katello/errors_controller.rb
katello-3.0.0.rc1 app/controllers/katello/errors_controller.rb