public class TemplateModelException extends TemplateException
ObjectWrapper
-s may throw this when wrapping/unwrapping fails, or TemplateModel
methods throw this
if the requested data can't be retrieved.Modifier | Constructor and Description |
---|---|
|
TemplateModelException()
Constructs a TemplateModelException with no
specified detail message.
|
|
TemplateModelException(java.lang.Exception cause)
The same as
TemplateModelException(Throwable) ; it's exists only for binary
backward-compatibility. |
|
TemplateModelException(java.lang.String description)
Constructs a TemplateModelException with the
specified detail message.
|
|
TemplateModelException(java.lang.String description,
boolean replaceWithCause,
java.lang.Throwable cause)
Constructs a TemplateModelException with both a description of the error
that occurred and the underlying Exception that caused this exception
to be raised.
|
|
TemplateModelException(java.lang.String description,
java.lang.Exception cause)
The same as
TemplateModelException(String, Throwable) ; it's exists only for binary
backward-compatibility. |
|
TemplateModelException(java.lang.String description,
java.lang.Throwable cause)
|
|
TemplateModelException(java.lang.Throwable cause)
Constructs a TemplateModelException with the given underlying
Exception, but no detail message.
|
protected |
TemplateModelException(java.lang.Throwable cause,
Environment env,
freemarker.core._ErrorDescriptionBuilder descriptionBuilder,
boolean preventAmbiguity)
Don't use this; this is to be used internally by FreeMarker.
|
protected |
TemplateModelException(java.lang.Throwable cause,
Environment env,
java.lang.String description,
boolean preventAmbiguity)
Don't use this; this is to be used internally by FreeMarker.
|
Modifier and Type | Method and Description |
---|---|
boolean |
getReplaceWithCause()
Indicates that the cause exception should be thrown instead of this exception; it was only wrapped into this
exception due to API constraints.
|
getBlamedExpressionString, getCauseException, getColumnNumber, getEndColumnNumber, getEndLineNumber, getEnvironment, getFTLInstructionStack, getLineNumber, getMessage, getMessageWithoutStackTop, getTemplateName, getTemplateSourceName, printStackTrace, printStackTrace, printStackTrace, printStackTrace, printStandardStackTrace, printStandardStackTrace
public TemplateModelException()
public TemplateModelException(java.lang.String description)
description
- the detail message.public TemplateModelException(java.lang.Exception cause)
TemplateModelException(Throwable)
; it's exists only for binary
backward-compatibility.public TemplateModelException(java.lang.Throwable cause)
cause
- the underlying Exception
that caused this
exception to be raisedpublic TemplateModelException(java.lang.String description, java.lang.Exception cause)
TemplateModelException(String, Throwable)
; it's exists only for binary
backward-compatibility.public TemplateModelException(java.lang.String description, java.lang.Throwable cause)
public TemplateModelException(java.lang.String description, boolean replaceWithCause, java.lang.Throwable cause)
description
- the description of the error that occurredreplaceWithCause
- See getReplaceWithCause()
; usually false
, unless you are forced to wrap
TemplateException
into a TemplateModelException
merely due to API constraints.cause
- the underlying Exception
that caused this
exception to be raisedprotected TemplateModelException(java.lang.Throwable cause, Environment env, java.lang.String description, boolean preventAmbiguity)
preventAmbiguity
- its value is ignored; it's only to prevent constructor selection ambiguities for
backward-compatibilityprotected TemplateModelException(java.lang.Throwable cause, Environment env, freemarker.core._ErrorDescriptionBuilder descriptionBuilder, boolean preventAmbiguity)
preventAmbiguity
- its value is ignored; it's only to prevent constructor selection ambiguities for
backward-compatibilitypublic boolean getReplaceWithCause()
TemplateModelException
, but the exception to propagate is a more generic TemplateException
.
The error handler mechanism of FreeMarker will replace the exception with its Throwable.getCause()
when it has
bubbled up to a place where that constraint doesn't apply anymore.