Package com.fauna.exception
Class ServiceException
- java.lang.Object
- 
- java.lang.Throwable
- 
- java.lang.Exception
- 
- java.lang.RuntimeException
- 
- com.fauna.exception.FaunaException
- 
- com.fauna.exception.ServiceException
 
 
 
 
 
- 
- All Implemented Interfaces:
- java.io.Serializable
 - Direct Known Subclasses:
- AbortException,- AuthenticationException,- AuthorizationException,- ConstraintFailureException,- ContendedTransactionException,- InvalidRequestException,- QueryCheckException,- QueryRuntimeException,- QueryTimeoutException,- ServiceInternalException,- ThrottlingException
 
 public class ServiceException extends FaunaException An exception representing a query failure returned by Fauna.This exception extends FaunaExceptionand provides detailed information about the failed query, including HTTP status codes, error codes, statistics, and other metadata.- See Also:
- Serialized Form
 
- 
- 
Constructor SummaryConstructors Constructor Description ServiceException(QueryFailure response)Constructs a newServiceExceptionwith the specifiedQueryFailureresponse.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetErrorCode()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.QueryFailuregetResponse()Returns theQueryFailureresponse associated with this exception.java.lang.LonggetSchemaVersion()Returns the schema version used during query execution.QueryStatsgetStats()Returns the statistics associated with the failed query.intgetStatusCode()Returns the HTTP status code of the response returned by the query request.java.lang.StringgetSummary()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.
 
- 
- 
- 
Constructor Detail- 
ServiceExceptionpublic ServiceException(QueryFailure response) Constructs a newServiceExceptionwith the specifiedQueryFailureresponse.- Parameters:
- response- The- QueryFailureobject containing details about the failed query.
 
 
- 
 - 
Method Detail- 
getResponsepublic QueryFailure getResponse() Returns theQueryFailureresponse associated with this exception.- Returns:
- The QueryFailureobject containing details of the query failure.
 
 - 
getStatusCodepublic int getStatusCode() Returns the HTTP status code of the response returned by the query request.- Returns:
- The HTTP status code as an integer.
 
 - 
getErrorCodepublic 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.
 
 - 
getSummarypublic java.lang.String getSummary() Returns a brief summary of the error.- Returns:
- A Stringcontaining the error summary.
 
 - 
getStatspublic QueryStats getStats() Returns the statistics associated with the failed query.- Returns:
- A QueryStatsobject containing statistical information for the failed query.
 
 - 
getTxnTspublic 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, orOptional.empty()if not available.
 
 - 
getSchemaVersionpublic java.lang.Long getSchemaVersion() Returns the schema version used during query execution.- Returns:
- The schema version as a Longvalue.
 
 - 
getQueryTagspublic 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.
 
 
- 
 
-