Package limn.io
Class MalformedContentException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
limn.io.MalformedContentException
- All Implemented Interfaces:
Serializable
What a file, a resource or a block of bytes is refused with when what it holds is not what its
format says: a picture, a sound, a video, a font, a model, a theme, cut short or wrong in any
way. It is the one exception an application that opens a user's file catches to tell the user
the file is broken.
It is not what a file that cannot be read arrives as, which is an I/O failure
(IOException or UncheckedIOException); nor a format nothing
here decodes, which is an UnsupportedOperationException; nor a wrong argument of the
caller's own, which stays an IllegalArgumentException. Its message says what is wrong,
in words for a log.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionMalformedContentException(String format, String message) MalformedContentException(String format, String message, long position, @Nullable Throwable cause) MalformedContentException(String format, String message, @Nullable Throwable 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
-
MalformedContentException
- Parameters:
format- the format's name as a person writes it,"glTF","PNG"message- what is wrong with the content
-
MalformedContentException
- Parameters:
format- the format's namemessage- what is wrong with the contentcause- what a decoder underneath said, ornull
-
MalformedContentException
public MalformedContentException(String format, String message, long position, @Nullable Throwable cause) - Parameters:
format- the format's namemessage- what is wrong with the contentposition- where: a line of a text, counted from 1, or an offset into the bytes, counted from 0, as the format's reader documents;-1for unknowncause- what a decoder underneath said, ornull
-
-
Method Details
-
format
- Returns:
- the name of the format the content was read as
-
position
public long position()- Returns:
- the line or the offset the reader stopped at, or
-1where it knows none
-