Package org.basex.query
Class QueryException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- org.basex.query.QueryException
-
- All Implemented Interfaces:
Serializable
public class QueryException extends Exception
Thrown to indicate an exception during the parsing or evaluation of a query.- Author:
- BaseX Team 2005-22, BSD License, Christian Gruen
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description QueryException(String message)
Constructor, specifying a simple error message.QueryException(Throwable cause)
Constructor, specifying an exception or error.QueryException(InputInfo info, QueryError error, Object... ext)
Default constructor.QueryException(InputInfo info, QNm name, String message, Object... ext)
Constructor, specifying the error code and message as string.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description QueryException
add(InputInfo ii)
Adds an input info to the stack.int
column()
Returns the error column.QueryError
error()
Returns the error.String
file()
Returns the file.String
getLocalizedMessage()
String
getMessage()
InputInfo
info()
Returns the input info.QueryException
info(InputInfo ii)
Sets input info.boolean
isCatchable()
Checks if this exception can be caught by atry/catch
expression.int
line()
Returns the error line.int
markedColumn()
Returns the marked error column.QueryException
notCatchable()
Makes this exception uncatchable by atry/catch
expression.QNm
qname()
Returns the error name.QueryException
suggest(InputParser qp)
Sets code suggestions.Value
value()
Returns the error value.QueryException
value(Value val)
Sets the error value.-
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
-
-
-
Constructor Detail
-
QueryException
public QueryException(Throwable cause)
Constructor, specifying an exception or error.QueryError.BASEX_ERROR_X
will be set as error code.- Parameters:
cause
- exception or error
-
QueryException
public QueryException(String message)
Constructor, specifying a simple error message.QueryError.BASEX_ERROR_X
will be set as error code.- Parameters:
message
- error message
-
QueryException
public QueryException(InputInfo info, QueryError error, Object... ext)
Default constructor.- Parameters:
info
- input info (can benull
)error
- error referenceext
- error extension
-
-
Method Detail
-
column
public final int column()
Returns the error column.- Returns:
- error column
-
markedColumn
public final int markedColumn()
Returns the marked error column.- Returns:
- marked error column
-
line
public final int line()
Returns the error line.- Returns:
- error line
-
file
public final String file()
Returns the file.- Returns:
- error line
-
suggest
public final QueryException suggest(InputParser qp)
Sets code suggestions.- Parameters:
qp
- query parser- Returns:
- self reference
-
add
public final QueryException add(InputInfo ii)
Adds an input info to the stack.- Parameters:
ii
- input info- Returns:
- self reference
-
info
public final QueryException info(InputInfo ii)
Sets input info.- Parameters:
ii
- input info- Returns:
- self reference
-
info
public final InputInfo info()
Returns the input info.- Returns:
- input info
-
value
public final QueryException value(Value val)
Sets the error value.- Parameters:
val
- error value- Returns:
- self reference
-
qname
public final QNm qname()
Returns the error name.- Returns:
- error name
-
error
public final QueryError error()
Returns the error.- Returns:
- error
-
value
public final Value value()
Returns the error value.- Returns:
- error value
-
getLocalizedMessage
public String getLocalizedMessage()
- Overrides:
getLocalizedMessage
in classThrowable
-
getMessage
public String getMessage()
- Overrides:
getMessage
in classThrowable
-
isCatchable
public boolean isCatchable()
Checks if this exception can be caught by atry/catch
expression.- Returns:
- result of check
-
notCatchable
public final QueryException notCatchable()
Makes this exception uncatchable by atry/catch
expression.- Returns:
- self reference for convenience
-
-