Exception: Exocora::TemplateError

Inherits:
RuntimeError
  • Object
show all
Defined in:
lib/exocora/errors.rb

Overview

Represents an error encountered when processing a template.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message, exception) ⇒ TemplateError

Returns a new instance of TemplateError.



32
33
34
35
# File 'lib/exocora/errors.rb', line 32

def initialize(message, exception)
  @message = message
  @exception = exception
end

Instance Attribute Details

#exceptionObject

Returns the value of attribute exception.



31
32
33
# File 'lib/exocora/errors.rb', line 31

def exception
  @exception
end

#messageObject

Returns the value of attribute message.



31
32
33
# File 'lib/exocora/errors.rb', line 31

def message
  @message
end

Instance Method Details

#to_htmlObject



37
38
39
40
41
42
43
44
45
# File 'lib/exocora/errors.rb', line 37

def to_html
  "<p>" + Erubis::XmlHelper::escape_xml(@message) + "</p>" +
  "<p>The original exception was:</p>" +
  if @exception.respond_to? :to_html
    @exception.to_html
  else
    Erubis::XmlHelper::escape_xml(@exception.to_s)
  end
end