Class InvalidLetterException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
com.nsdev.lettergenerator.exception.LetterPdfException
com.nsdev.lettergenerator.exception.InvalidLetterException
- All Implemented Interfaces:
Serializable
Indicates invalid JSON, markup, model data or registered font configuration.
fieldPath()
identifies the failing input location; the exception message starts with that path followed by
the diagnostic. Paths can refer to document fields, template nodes or font registrations rather
than only JSON properties.- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionInvalidLetterException(String fieldPath, String message) Creates a validation failure without an underlying cause.InvalidLetterException(String fieldPath, String message, Throwable cause) Creates a validation failure retaining its input location and 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
-
InvalidLetterException
Creates a validation failure without an underlying cause. The message is prefixed with the supplied path; neither argument is validated here.- Parameters:
fieldPath- input location to retain and prefix in the messagemessage- diagnostic explaining why that location is invalid
-
InvalidLetterException
Creates a validation failure retaining its input location and underlying cause. The message is prefixed with the supplied path; neither path nor message is validated here.- Parameters:
fieldPath- input location to retain and prefix in the messagemessage- diagnostic explaining why that location is invalidcause- underlying parsing, decoding or validation failure, or null
-
-
Method Details
-
fieldPath
Returns the input location supplied when this exception was constructed. Library-generated failures use paths such asdocument, indexed model fields,template..., orfonts[family].- Returns:
- the retained field path; it can be null if supplied by a caller
-