XCC/J 3.2-9

com.marklogic.xcc.exceptions
Class XQueryException

java.lang.Object
  extended byjava.lang.Throwable
      extended byjava.lang.Exception
          extended bycom.marklogic.xcc.exceptions.XccException
              extended bycom.marklogic.xcc.exceptions.RequestException
                  extended bycom.marklogic.xcc.exceptions.RequestServerException
                      extended bycom.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 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.
 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
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 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
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.

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.

XCC/J 3.2-9

Copyright © 2003-2008 Mark Logic Corporation, All Rights Reserved.

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