Class GremlinError


  • public class GremlinError
    extends Object
    Exception utility class that generates exceptions in the form expected in a ResponseStatus for different issues that the server can encounter.
    • Method Detail

      • getCode

        public io.netty.handler.codec.http.HttpResponseStatus getCode()
      • getMessage

        public String getMessage()
      • getException

        public String getException()
      • binding

        public static GremlinError binding​(int bindingsCount,
                                           int allowedSize)
      • timedInterruptTimeout

        public static GremlinError timedInterruptTimeout()
      • transactionNotFound

        public static GremlinError transactionNotFound​(String transactionId)
        Creates an error for when a transaction is not found on the server. This typically occurs when:
        • The transaction ID was never registered (client didn't call begin)
        • The transaction timed out and was automatically rolled back
        • The transaction was already committed or rolled back
        Parameters:
        transactionId - The transaction ID that was not found
        Returns:
        A GremlinError with appropriate message and status code
      • transactionalControlRequiresTransaction

        public static GremlinError transactionalControlRequiresTransaction()
        Creates an error for when commit or rollback is sent without a transaction ID.
        Returns:
        A GremlinError with appropriate message and status code
      • beginHasTransactionId

        public static GremlinError beginHasTransactionId()
        Creates an error for when a begin request is sent with a user-supplied transaction ID. The server generates transaction IDs; clients should not provide them on begin.
        Returns:
        A GremlinError with appropriate message and status code
      • maxTransactionsExceeded

        public static GremlinError maxTransactionsExceeded​(String exceededErrorMessage)
        Creates an error for when the maximum number of concurrent transactions is exceeded.
        Parameters:
        exceededErrorMessage - The error message containing a maximum number of concurrent transactions
        Returns:
        A GremlinError with appropriate message and status code
      • transactionTimeout

        public static GremlinError transactionTimeout​(String transactionId,
                                                      String operation)
        Creates an error for when a transaction operation times out.
        Parameters:
        transactionId - The transaction ID that timed out
        operation - The operation that timed out (e.g., "commit", "rollback", "execute")
        Returns:
        A GremlinError with appropriate message and status code
      • transactionNotSupported

        public static GremlinError transactionNotSupported​(UnsupportedOperationException uoe)
        Creates an error for when the requested graph does not support transactions.
        Parameters:
        uoe - The exception stating that transactions aren't supported
        Returns:
        A GremlinError with appropriate message and status code
      • transactionUnableToStart

        public static GremlinError transactionUnableToStart​(String message)
        Creates an error for when the transaction couldn't begin.
        Parameters:
        message - The error message (likely from a TransactionException)
        Returns:
        A GremlinError with appropriate message and status code