Class TemplateException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
io.github.chkrishnatej.rp3200.template.TemplateException
- All Implemented Interfaces:
Serializable
Thrown when a receipt template cannot be compiled or rendered.
The message always says what is wrong and where, for example:
Line 3: '{{#each items}}' is never closed- thrown byReceiptTemplate.compile(String): the placeholder structure is broken.Output line 5 "[blink]x": Unknown tag [blink] ...- thrown while rendering: the markup is wrong. "Output line" counts lines after placeholders were filled in;ReceiptTemplate.expand(Object)shows that intermediate text.
It is unchecked: a broken template is a programming error, best caught by a unit test
that renders every template once (see ReceiptTemplate.preview(Object)).
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionTemplateException(String message) Creates an exception with a message.TemplateException(String message, Throwable cause) Creates an exception with a message and the underlying cause. -
Method Summary
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
TemplateException
Creates an exception with a message.- Parameters:
message- what is wrong and where
-
TemplateException
Creates an exception with a message and the underlying cause.- Parameters:
message- what is wrong and wherecause- the original exception
-