123456789_123456789_123456789_123456789_123456789_

Exception: ActionView::SyntaxErrorInTemplate

Do not use. This class is for internal use only.
Relationships & Source Files
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
self, Template::Error, ActionViewError, StandardError
Instance Chain:
self, Template::Error, ActionViewError, StandardError
Inherits: ActionView::Template::Error
Defined in: actionview/lib/action_view/template/error.rb

Constant Summary

Template::Error - Inherited

SOURCE_CODE_RADIUS

Class Method Summary

Instance Attribute Summary

Template::Error - Inherited

#cause

Override to prevent #cause resetting during re-raise.

#template

Instance Method Summary

Constructor Details

.new(template, offending_code_string) ⇒ SyntaxErrorInTemplate

[ GitHub ]

  
# File 'actionview/lib/action_view/template/error.rb', line 246

def initialize(template, offending_code_string)
  @offending_code_string = offending_code_string
  super(template)
end

Instance Method Details

#annotated_source_code

[ GitHub ]

  
# File 'actionview/lib/action_view/template/error.rb', line 257

def annotated_source_code
  @offending_code_string.split("\n").map.with_index(1) { |line, index|
    indentation = " " * 4
    "#{index}:#{indentation}#{line}"
  }
end

#message

[ GitHub ]

  
# File 'actionview/lib/action_view/template/error.rb', line 251

def message
  <<~MESSAGE
    Encountered a syntax error while rendering template: check #{@offending_code_string}
  MESSAGE
end