com.marklogic.xcc.exceptions

## Class XQueryException

- java.lang.Object
- - java.lang.Throwable
  - - java.lang.Exception
    - - com.marklogic.xcc.exceptions.XccException
      - - com.marklogic.xcc.exceptions.RequestException
        - - com.marklogic.xcc.exceptions.RequestServerException
          - - com.marklogic.xcc.exceptions.QueryException
            - - com.marklogic.xcc.exceptions.XQueryException

- All Implemented Interfaces:
    java.io.Serializable

      public class XQueryException
      extends QueryException

  A server exception resulting from an error encountered while evaluating XQuery. Note that some such exceptions are retryable.
  See Also:
    `RequestException.isRetryable()`, `RetryableXQueryException`, Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `XQueryException(Request request, java.lang.String code, java.lang.String w3cCode, java.lang.String xqueryVersion, java.lang.String message, java.lang.String formatString, java.lang.String expr, boolean isRetryable, java.lang.String[] data, QueryStackFrame[] stack)` Constructs an XQueryException

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.lang.String` | `getXQueryVersion()` Returns the XQuery version (0.9-ml, 1.0-ml or 1.0) of the module that threw the exception.

    - ### Methods inherited from class com.marklogic.xcc.exceptions.QueryException

      `getCode, getData, getFormatString, getStack, getW3CCode, toString`

    - ### Methods inherited from class com.marklogic.xcc.exceptions.RequestException

      `appendRequestInfo, getRequest, isRetryable, isRetryAdvised`

    - ### Methods inherited from class java.lang.Throwable

      `addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### XQueryException

          public XQueryException(Request request,
                                 java.lang.String code,
                                 java.lang.String w3cCode,
                                 java.lang.String xqueryVersion,
                                 java.lang.String message,
                                 java.lang.String formatString,
                                 java.lang.String expr,
                                 boolean isRetryable,
                                 java.lang.String[] data,
                                 QueryStackFrame[] stack)

      Constructs an XQueryException
      Parameters:
        `request` - The `Request` object to which this exception applies
        `code` - the symbolic exception code
        `w3cCode` - the exception code defined by the XQuery spec, if any
        `xqueryVersion` - the XQuery version of the module that threw an exception
        `message` - the exception message
        `formatString` - the exception format string
        `expr` - The expression that caused the exception, if applicable
        `isRetryable` - retrying the operation may succeed
        `data` - the exception data
        `stack` - the xquery evaluator stack trace

  - ### Method Detail

    - #### getXQueryVersion

          public java.lang.String getXQueryVersion()

      Returns the XQuery version (0.9-ml, 1.0-ml or 1.0) of the module that threw the exception.
      Returns:
        A String that represents the XQuery version.

Copyright © 2025 MarkLogic Corporation. All Rights Reserved.

Complete online documentation for MarkLogic Server, XQuery and related components may be found at developer.marklogic.com