Class: RubyFriendlyError::Renderers::ExceptionRenderer

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby_friendly_error/renderers/exception_renderer.rb

Direct Known Subclasses

StandardErrorRenderer, SyntaxErrorRenderer

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(exception, eval_file_content) ⇒ ExceptionRenderer

Returns a new instance of ExceptionRenderer.



8
9
10
11
# File 'lib/ruby_friendly_error/renderers/exception_renderer.rb', line 8

def initialize exception, eval_file_content
  @exception         = exception
  @eval_file_content = eval_file_content
end

Instance Attribute Details

#eval_file_contentObject (readonly)

Returns the value of attribute eval_file_content.



6
7
8
# File 'lib/ruby_friendly_error/renderers/exception_renderer.rb', line 6

def eval_file_content
  @eval_file_content
end

#exceptionObject (readonly)

Returns the value of attribute exception.



5
6
7
# File 'lib/ruby_friendly_error/renderers/exception_renderer.rb', line 5

def exception
  @exception
end

Instance Method Details

#renderObject



13
14
15
16
17
18
19
20
21
# File 'lib/ruby_friendly_error/renderers/exception_renderer.rb', line 13

def render
  display_backtrace exception.backtrace unless eval?

  display_main_message

  display_error_detail

  display_message
end