Exception: ViewComponent::TemplateError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/view_component/errors.rb

Instance Method Summary collapse

Constructor Details

#initialize(errors, templates = nil) ⇒ TemplateError

Returns a new instance of TemplateError.



20
21
22
23
24
25
26
27
28
29
30
# File 'lib/view_component/errors.rb', line 20

def initialize(errors, templates = nil)
  message = errors.join("\n")

  if templates
    message << "\n"
    message << "Templates:\n"
    message << templates.map(&:inspect).join("\n")
  end

  super(message)
end