Sha256: 4f6429a401ae70612bcecdccd0d24e1b8c1b86ad29466961dade0c837acb9f1d
Contents?: true
Size: 768 Bytes
Versions: 22
Compression:
Stored size: 768 Bytes
Contents
module Katello class ErrorsController < Katello::ApplicationController skip_before_action :require_user, :require_org skip_before_action :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
22 entries across 22 versions & 1 rubygems