Class: TestServer::ErrorsController

Inherits:
ApplicationController show all
Defined in:
app/controllers/test_server/errors_controller.rb

Instance Method Summary collapse

Methods included from WebHelper

#configure_caching, #encode, #generate_eicar, #generate_random_string, #generate_string

Instance Method Details

#showObject



4
5
6
7
8
9
10
11
12
13
14
# File 'app/controllers/test_server/errors_controller.rb', line 4

def show
  handler = ErrorHandler.find(env['action_dispatch.exception'])

  @error_summary = handler.summary(:html)
  @error_details = handler.details(:html)

  respond_to do |format|
    format.html { render status: handler.status_code }
    format.json { render json: handler.to_hash, status: handler.status_code }
  end
end