Sha256: 3763a5b66a1c15c3f87c3664eb21bd928a820ba52a933711083cbf1f88f2c383

Contents?: true

Size: 561 Bytes

Versions: 2

Compression:

Stored size: 561 Bytes

Contents

module RailsInfo::Controller::ExceptionDiagnostics
  extend ActiveSupport::Concern

  included do
    rescue_from Exception, with: :custom_stack_trace
  end

  private
  
  def custom_stack_trace(exception)  
    if Rails.env.development?
      @stack_trace = RailsInfo::StackTracePresenter.new(
        view_context, stack_trace: { 
          body: exception.backtrace, exception: exception , request: request
        }  
      )
      
      render 'rails_info/stack_traces/new', layout: 'rails_info/exception'
    else
      raise exception
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rails_info-0.1.1 lib/rails_info/controller/exception_diagnostics.rb
rails_info-0.1.0 lib/rails_info/controller/exception_diagnostics.rb