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 aResponseStatusfor different issues that the server can encounter.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static GremlinErrorbeginHasTransactionId()Creates an error for when a begin request is sent with a user-supplied transaction ID.static GremlinErrorbinding()static GremlinErrorbinding(int bindingsCount, int allowedSize)static GremlinErrorbinding(String aliased)static GremlinErrorbinding(Set<String> badBindings)static GremlinErrorfailStep(Failure failure)static GremlinErrorgeneral(Throwable t)io.netty.handler.codec.http.HttpResponseStatusgetCode()StringgetException()StringgetMessage()static GremlinErrorinvalidGremlinType(RequestMessage requestMessage)static GremlinErrorlongFrame(Throwable t)static GremlinErrorlongRequest(RequestMessage requestMessage)static GremlinErrormaxTransactionsExceeded(String exceededErrorMessage)Creates an error for when the maximum number of concurrent transactions is exceeded.static GremlinErrorparsing(GremlinParserException error)static GremlinErrorrateLimiting()static GremlinErrorserialization(Exception ex)static GremlinErrortemporary(Throwable t)static GremlinErrortimedInterruptTimeout()static GremlinErrortimeout(RequestMessage requestMessage)static GremlinErrortransactionalControlRequiresTransaction()Creates an error for when commit or rollback is sent without a transaction ID.static GremlinErrortransactionNotFound(String transactionId)Creates an error for when a transaction is not found on the server.static GremlinErrortransactionNotSupported(UnsupportedOperationException uoe)Creates an error for when the requested graph does not support transactions.static GremlinErrortransactionTimeout(String transactionId, String operation)Creates an error for when a transaction operation times out.static GremlinErrortransactionUnableToStart(String message)Creates an error for when the transaction couldn't begin.static GremlinErrorwrongSerializer(Exception ex)
-
-
-
Method Detail
-
getCode
public io.netty.handler.codec.http.HttpResponseStatus getCode()
-
getMessage
public String getMessage()
-
getException
public String getException()
-
invalidGremlinType
public static GremlinError invalidGremlinType(RequestMessage requestMessage)
-
binding
public static GremlinError binding()
-
binding
public static GremlinError binding(Set<String> badBindings)
-
binding
public static GremlinError binding(int bindingsCount, int allowedSize)
-
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 outoperation- 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
-
-