Class: ExceptionHunter::ErrorPresenter

Inherits:
Object
  • Object
show all
Defined in:
app/presenters/exception_hunter/error_presenter.rb

Defined Under Namespace

Classes: BacktraceLine

Instance Method Summary collapse

Constructor Details

#initialize(error) ⇒ ErrorPresenter

Returns a new instance of ErrorPresenter.



8
9
10
# File 'app/presenters/exception_hunter/error_presenter.rb', line 8

def initialize(error)
  @error = error
end

Instance Method Details

#backtraceObject



12
13
14
15
16
# File 'app/presenters/exception_hunter/error_presenter.rb', line 12

def backtrace
  (error.backtrace || []).map do |line|
    format_backtrace_line(line)
  end
end

#environment_dataObject



18
19
20
# File 'app/presenters/exception_hunter/error_presenter.rb', line 18

def environment_data
  error.environment_data&.except('params') || {}
end

#tracked_paramsObject



22
23
24
# File 'app/presenters/exception_hunter/error_presenter.rb', line 22

def tracked_params
  (error.environment_data || {})['params']
end