Class 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 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 be null)
        error - error reference
        ext - error extension
      • QueryException

        public QueryException​(InputInfo info,
                              QNm name,
                              String message,
                              Object... ext)
        Constructor, specifying the error code and message as string.
        Parameters:
        info - input info (can be null)
        name - error code
        message - error message
        ext - 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
      • isCatchable

        public boolean isCatchable()
        Checks if this exception can be caught by a try/catch expression.
        Returns:
        result of check
      • notCatchable

        public final QueryException notCatchable()
        Makes this exception uncatchable by a try/catch expression.
        Returns:
        self reference for convenience