module Gaffe::Errors

Public Instance Methods

show() click to toggle source
# File lib/gaffe/errors.rb, line 11
def show
  render "errors/#{@rescue_response}", status: @status_code
rescue ActionView::MissingTemplate
  render 'errors/internal_server_error', status: 500
end

Protected Instance Methods

fetch_exception() click to toggle source
# File lib/gaffe/errors.rb, line 19
def fetch_exception
  @exception = request.env['action_dispatch.exception']
  @status_code = ActionDispatch::ExceptionWrapper.new(request.env, @exception).status_code
  @rescue_response = ActionDispatch::ExceptionWrapper.rescue_responses[@exception.class.name]
end

Private Instance Methods

append_view_paths() click to toggle source
# File lib/gaffe/errors.rb, line 27
def append_view_paths
  append_view_path Gaffe.root.join('app/views')
end