Overview | Package | Class | Tree | Deprecated | Index | Help
| XCC/J 4.2-9
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## 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.XQueryException

All Implemented Interfaces:
  Serializable

Direct Known Subclasses:
  RetryableXQueryException

    public class XQueryException

extends RequestServerException

A server exception resulting from an error encountered while evaluating XQuery. Note that some such exceptions are retryable.

See Also:
  `isRetryable()`, `RetryableXQueryException`, Serialized Form

Constructor Summary
`XQueryException(Request request, String code, String w3cCode, String xqueryVersion, String message, String formatString, String expr, boolean retryable, String[] data, XQueryStackFrame[] stack)` Constructs an XQueryException

Method Summary
`String` | `getCode()` Returns the server error code for this XQuery exception.
`String[]` | `getData()`
`String` | `getFormatString()`
`XQueryStackFrame[]` | `getStack()` Get an array of `XQueryStackFrame` objects that represent the XQuery stack frame returned by the server.
`String` | `getW3CCode()` Returns the error code defined by the WC3 XQuery spec that corresponds to this exception, if any.
`String` | `getXQueryVersion()` Returns the XQuery version (0.9-ml, 1.0-ml or 1.0) of the module that threw the exception.
`boolean` | `isRetryable()` Returns true if the server indicates that this request might succeeed if resubmitted.
`String` | `toString()` Returns a string representation (possibly multiline) of the XQuery error message and stack frame.

Methods inherited from class com.marklogic.xcc.exceptions.RequestException
`appendRequestInfo, getRequest`

Methods inherited from class java.lang.Throwable
`fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, 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,
                           String code,
                           String w3cCode,
                           String xqueryVersion,
                           String message,
                           String formatString,
                           String expr,
                           boolean retryable,
                           String[] data,
                           XQueryStackFrame[] 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
    `retryable` - retrying the operation may succeed
    `data` - the exception data
    `stack` - the xquery evaluator stack trace

Method Detail

### getCode

    public String getCode()

  Returns the server error code for this XQuery exception.

  Returns:
    A string that is a server error code, such as XDMP-FOO.

### getW3CCode

    public String getW3CCode()

  Returns the error code defined by the WC3 XQuery spec that corresponds to this exception, if any.

  Returns:
    A string that is the W3C error code, such as err:BLAH123, if one is defined, else null.
  Since:
    4.0

### getXQueryVersion

    public 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.

### getFormatString

    public String getFormatString()

### isRetryable

    public boolean isRetryable()

  Returns true if the server indicates that this request might succeeed if resubmitted.

  Note that if method returns true, then this exception will also be an instance of `RetryableXQueryException`.

  Note also that retryable exceptions will be automatically resubmitted if the `RequestOptions` associated with the request indicate to do so.

  Returns:
    true if the request is retryable, false if the request cannot be processed as submitted.

### getData

    public String[] getData()

### getStack

    public XQueryStackFrame[] getStack()

  Get an array of `XQueryStackFrame` objects that represent the XQuery stack frame returned by the server.

  Returns:
    An array (possibly zero length) of XQuery evaluator stack frames.

### toString

    public String toString()

  Returns a string representation (possibly multiline) of the XQuery error message and stack frame.

  Overrides:
    `toString` in class `RequestException`
  Returns:
    A string representation of this XQuery exception.

Overview | Package | Class | Tree | Deprecated | Index | Help
| XCC/J 4.2-9
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2003-2012 MarkLogic Corporation, All Rights Reserved.

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