Class GremlinError

java.lang.Object
org.apache.tinkerpop.gremlin.server.util.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 Details

    • getCode

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

      public String getMessage()
    • getException

      public String getException()
    • invalidGremlinType

      public static GremlinError invalidGremlinType(RequestMessage requestMessage)
    • parameter

      public static GremlinError parameter()
    • incorrectParameterFormat

      public static GremlinError incorrectParameterFormat(String parameters, GremlinParserException gpe)
    • parameter

      public static GremlinError parameter(Set<String> badParameters)
    • parameter

      public static GremlinError parameter(int parametersCount, int allowedSize)
    • batchSize

      public static GremlinError batchSize(String batchSize)
    • binding

      public static GremlinError binding(String aliased)
    • parsing

      public static GremlinError parsing(GremlinParserException error)
    • timeout

      public static GremlinError timeout(RequestMessage requestMessage)
    • timedInterruptTimeout

      public static GremlinError timedInterruptTimeout()
    • rateLimiting

      public static GremlinError rateLimiting()
    • serialization

      public static GremlinError serialization(Exception ex)
    • wrongSerializer

      public static GremlinError wrongSerializer(Exception ex)
    • longFrame

      public static GremlinError longFrame(Throwable t)
    • longRequest

      public static GremlinError longRequest(RequestMessage requestMessage)
    • temporary

      public static GremlinError temporary(Throwable t)
    • failStep

      public static GremlinError failStep(Failure failure)
    • general

      public static GremlinError general(Throwable t)
    • 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
    • scriptEngineNotAvailable

      public static GremlinError scriptEngineNotAvailable(String language)
      Creates an error for when a requested script engine is not available on the server.
      Parameters:
      language - the requested script engine name
      Returns:
      A GremlinError with appropriate message and status code
    • traversalSourceMismatch

      public static GremlinError traversalSourceMismatch(String expected, String actual)
      Creates an error for when a transactional request uses a different traversal source name than the one bound at begin time.
      Parameters:
      expected - The traversal source name bound at transaction begin
      actual - The traversal source name in the current request
      Returns:
      A GremlinError with appropriate message and status code