Package com.fauna.exception
Class ErrorHandler
- java.lang.Object
-
- com.fauna.exception.ErrorHandler
-
public final class ErrorHandler extends java.lang.Object
Provides error handling based on error codes and HTTP status codes returned by Fauna.The
ErrorHandler
class contains a static method to manage various error scenarios by analyzing the HTTP status code and specific error codes, mapping them to relevant exceptions.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
handleQueryFailure(int statusCode, QueryFailure failure)
Handles errors based on the HTTP status code and error code returned by Fauna.
-
-
-
Method Detail
-
handleQueryFailure
public static void handleQueryFailure(int statusCode, QueryFailure failure)
Handles errors based on the HTTP status code and error code returned by Fauna.- Parameters:
statusCode
- The HTTP status code received from Fauna.failure
- TheQueryFailure
object containing details about the failure.- Throws:
AbortException
- Thrown if the transaction was aborted.AuthenticationException
- Thrown if authentication credentials are invalid or missing.AuthorizationException
- Thrown if authorization credentials are invalid or insufficient.ConstraintFailureException
- Thrown if the transaction failed a database constraint check.ContendedTransactionException
- Thrown if too much contention occurred during a transaction.InvalidRequestException
- Thrown if the request body does not conform to API specifications.QueryCheckException
- Thrown if the query failed validation checks.QueryRuntimeException
- Thrown if the query encountered a runtime error.QueryTimeoutException
- Thrown if the query exceeded the specified timeout.ServiceInternalException
- Thrown if an unexpected server error occurred.ThrottlingException
- Thrown if the query exceeded capacity limits.
-
-