public class LoaderException extends Exception
Constructor and Description |
---|
LoaderException(Throwable cause,
String sourceFileName)
Constructs a new
LoaderException without line information or the indication
that the cause of this error may have been a partial input. |
LoaderException(Throwable cause,
String sourceFileName,
int sourceLine,
boolean partialInput)
Constructs a new
LoaderException with the specified cause ,
the file name sourceFileName , the line sourceLine where the error
occurred, and indicating in the flag partialInput whether the cause of the
error may have been caused by a partial input (i.e., an unexpected EOF). |
Modifier and Type | Method and Description |
---|---|
String |
getLuaStyleErrorMessage()
Returns a Lua-style error message for this loader exception.
|
String |
getSourceFileName()
Returns the file name of the program that caused this exception.
|
int |
getSourceLine()
Returns the line in the source file that caused the exception.
|
boolean |
isPartialInputError()
Returns
true if this LoaderException was caused by an unexpected
EOF when processing the Lua program. |
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
public LoaderException(Throwable cause, String sourceFileName, int sourceLine, boolean partialInput)
LoaderException
with the specified cause
,
the file name sourceFileName
, the line sourceLine
where the error
occurred, and indicating in the flag partialInput
whether the cause of the
error may have been caused by a partial input (i.e., an unexpected EOF).cause
- the cause of the error, must not be null
sourceFileName
- source file name, may be null
when source file information
is omittedsourceLine
- the line in the source where the error occurred, may be non-positive
when this information is omittedpartialInput
- a flag indicating whether the cause of the error may have been
an unexpected EOFNullPointerException
- if cause
is null
public LoaderException(Throwable cause, String sourceFileName)
LoaderException
without line information or the indication
that the cause of this error may have been a partial input.cause
- the cause of the error, must not be null
sourceFileName
- source file name, may be null
when source file information
is omittedNullPointerException
- if cause
is null
public boolean isPartialInputError()
true
if this LoaderException
was caused by an unexpected
EOF when processing the Lua program.true
if this exception was caused by an unexpected EOFpublic String getSourceFileName()
null
if this information is not available.null
when this information
is not availablepublic int getSourceLine()
public String getLuaStyleErrorMessage()
The format of this error message is:
"SourceFileName:SourceLine: CauseMessage"
When no source file name is available, the source information prefix is omitted
(i.e., the error message is equal to CauseMessage
); when no source line information
is available, the SourceLine
string is equal to "?".
CauseMessage
is the error message as returner by the cause of this exception.
Copyright © 2016. All rights reserved.