Class: Spaghettiohs::ExceptionsController

Inherits:
ActionController::Base
  • Object
show all
Defined in:
app/controllers/spaghettiohs/exceptions_controller.rb

Overview

class ExceptionsController < ApplicationController

Instance Method Summary collapse

Instance Method Details

#showObject



8
9
10
11
12
13
14
15
16
17
18
# File 'app/controllers/spaghettiohs/exceptions_controller.rb', line 8

def show
	@exception       = env['action_dispatch.exception']
	@status_code     = ActionDispatch::ExceptionWrapper.new(env, @exception).status_code
	@rescue_response = ActionDispatch::ExceptionWrapper.rescue_responses[@exception.class.name]

	respond_to do |format|
		format.html { render :show, status: @status_code, layout: !request.xhr? }
		format.xml  { render xml: details, root: "error", status: @status_code }
		format.json { render json: {error: details}, status: @status_code }
	end
end