Class ServiceException

    • Constructor Summary

      Constructors 
      Constructor Description
      ServiceException​(QueryFailure response)
      Constructs a new ServiceException with the specified QueryFailure response.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getErrorCode()
      Returns the Fauna error code associated with the failure.
      java.util.Map<java.lang.String,​java.lang.String> getQueryTags()
      Returns a map of query tags for the failed query.
      QueryFailure getResponse()
      Returns the QueryFailure response associated with the exception.
      long getSchemaVersion()
      The schema version that was used for query execution.
      QueryStats getStats()
      Returns the statistics for the failed query.
      int getStatusCode()
      Returns the HTTP status code of the response returned by the query request.
      java.lang.String getSummary()
      Returns a summary of the error.
      long getTxnTs()
      Returns the faled query's last transaction timestamp.
      • Methods inherited from class java.lang.Throwable

        addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • ServiceException

        public ServiceException​(QueryFailure response)
        Constructs a new ServiceException with the specified QueryFailure response.
        Parameters:
        response - the QueryFailure object containing details about the failed query
    • Method Detail

      • getResponse

        public QueryFailure getResponse()
        Returns the QueryFailure response associated with the exception.
        Returns:
        the QueryFailure object
      • getStatusCode

        public int getStatusCode()
        Returns the HTTP status code of the response returned by the query request.
        Returns:
        the HTTP status code as an integer
      • getErrorCode

        public java.lang.String getErrorCode()
        Returns the Fauna error code associated with the failure.

        Codes indicate the cause of the error. It is safe to write programmatic logic against the code. They are part of the API contract.

        Returns:
        the error code as a String
      • getSummary

        public java.lang.String getSummary()
        Returns a summary of the error.
        Returns:
        a String containing the error summary
      • getStats

        public QueryStats getStats()
        Returns the statistics for the failed query.
        Returns:
        a QueryStats object containing statistical information
      • getTxnTs

        public long getTxnTs()
        Returns the faled query's last transaction timestamp.
        Returns:
        the transaction timestamp as a long value
      • getSchemaVersion

        public long getSchemaVersion()
        The schema version that was used for query execution.
        Returns:
        the schema version as a long value
      • getQueryTags

        public java.util.Map<java.lang.String,​java.lang.String> getQueryTags()
        Returns a map of query tags for the failed query.
        Returns:
        a Map containing query tags as key-value pairs