Exception: Locomotive::Common::RendererException
- Inherits:
-
DefaultException
- Object
- Exception
- 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.
38 39 40 41 42 43 |
# File 'lib/locomotive/common/exception.rb', line 38 def initialize(exception, name, template, liquid_context) self.name, self.template, self.liquid_context = name, template, liquid_context self.log_page_into_backtrace(exception) super(exception.) self.set_backtrace(exception.backtrace) end |
Instance Attribute Details
#liquid_context ⇒ Object
Returns the value of attribute liquid_context.
36 37 38 |
# File 'lib/locomotive/common/exception.rb', line 36 def liquid_context @liquid_context end |
#name ⇒ Object
Returns the value of attribute name.
36 37 38 |
# File 'lib/locomotive/common/exception.rb', line 36 def name @name end |
#template ⇒ Object
Returns the value of attribute template.
36 37 38 |
# File 'lib/locomotive/common/exception.rb', line 36 def template @template end |
Instance Method Details
#log_page_into_backtrace(exception) ⇒ Object
45 46 47 48 49 50 51 |
# File 'lib/locomotive/common/exception.rb', line 45 def log_page_into_backtrace(exception) line = self.template.line_offset line += (exception.respond_to?(:line) ? exception.line || 0 : 0) + 1 = "#{self.template.filepath}:#{line}:in `#{self.name}'" notifier.fatal "[ERROR] #{exception.} - #{}\n".red exception.backtrace.unshift end |