Exception: Exocora::TemplateError
- Inherits:
-
RuntimeError
- Object
- RuntimeError
- Exocora::TemplateError
- Defined in:
- lib/exocora/errors.rb
Overview
Represents an error encountered when processing a template.
Instance Attribute Summary collapse
-
#exception ⇒ Object
Returns the value of attribute exception.
-
#message ⇒ Object
Returns the value of attribute message.
Instance Method Summary collapse
-
#initialize(message, exception) ⇒ TemplateError
constructor
A new instance of TemplateError.
- #to_html ⇒ Object
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(, exception) @message = @exception = exception end |
Instance Attribute Details
#exception ⇒ Object
Returns the value of attribute exception.
31 32 33 |
# File 'lib/exocora/errors.rb', line 31 def exception @exception end |
#message ⇒ Object
Returns the value of attribute message.
31 32 33 |
# File 'lib/exocora/errors.rb', line 31 def @message end |
Instance Method Details
#to_html ⇒ Object
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 |