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, containing key-value pairs of tags.
      QueryFailure getResponse()
      Returns the QueryFailure response associated with this exception.
      java.lang.Long getSchemaVersion()
      Returns the schema version used during query execution.
      QueryStats getStats()
      Returns the statistics associated with the failed query.
      int getStatusCode()
      Returns the HTTP status code of the response returned by the query request.
      java.lang.String getSummary()
      Returns a brief summary of the error.
      java.util.Optional<java.lang.Long> getTxnTs()
      Returns the last transaction timestamp seen for the failed query, if available.
      • 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 this exception.
        Returns:
        The QueryFailure object containing details of the query failure.
      • 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.

        Fauna error codes indicate the specific cause of the error and are part of the API contract, allowing for programmatic logic based on the error type.

        Returns:
        The error code as a String.
      • getSummary

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

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

        public java.util.Optional<java.lang.Long> getTxnTs()
        Returns the last transaction timestamp seen for the failed query, if available.
        Returns:
        An Optional<Long> representing the last transaction timestamp, or Optional.empty() if not available.
      • getSchemaVersion

        public java.lang.Long getSchemaVersion()
        Returns the schema version used during 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, containing key-value pairs of tags.
        Returns:
        A Map<String, String> with query tags.