Exception: Locomotive::Common::RendererException
- Inherits:
-
DefaultException
- Object
- StandardError
- DefaultException
- Locomotive::Common::RendererException
- Defined in:
- lib/locomotive/common/exception.rb
Instance Attribute Summary collapse
-
#liquid_context ⇒ Object
Returns the value of attribute liquid_context.
-
#name ⇒ Object
Returns the value of attribute name.
-
#template ⇒ Object
Returns the value of attribute template.
Attributes inherited from DefaultException
Instance Method Summary collapse
-
#initialize(exception, name, template, liquid_context) ⇒ RendererException
constructor
A new instance of RendererException.
- #log_page_into_backtrace(exception) ⇒ Object
Methods inherited from DefaultException
Constructor Details
#initialize(exception, name, template, liquid_context) ⇒ RendererException
Returns a new instance of RendererException.
37 38 39 40 41 42 43 44 |
# File 'lib/locomotive/common/exception.rb', line 37 def initialize(exception, name, template, liquid_context) self.name = name self.template = template self.liquid_context = liquid_context log_page_into_backtrace(exception) super(exception.) set_backtrace(exception.backtrace) end |
Instance Attribute Details
#liquid_context ⇒ Object
Returns the value of attribute liquid_context.
35 36 37 |
# File 'lib/locomotive/common/exception.rb', line 35 def liquid_context @liquid_context end |
#name ⇒ Object
Returns the value of attribute name.
35 36 37 |
# File 'lib/locomotive/common/exception.rb', line 35 def name @name end |
#template ⇒ Object
Returns the value of attribute template.
35 36 37 |
# File 'lib/locomotive/common/exception.rb', line 35 def template @template end |
Instance Method Details
#log_page_into_backtrace(exception) ⇒ Object
46 47 48 49 50 51 52 |
# File 'lib/locomotive/common/exception.rb', line 46 def log_page_into_backtrace(exception) line = template.line_offset line += (exception.respond_to?(:line) ? exception.line || 0 : 0) + 1 = "#{template.filepath}:#{line}:in `#{name}'" notifier.fatal "[ERROR] #{exception.} - #{}\n".red exception.backtrace.unshift end |