From 2dafe16ffddbb31eb275b89d95388d0102aa6774 Mon Sep 17 00:00:00 2001 From: Yuqi Du Date: Wed, 31 Jan 2024 18:12:03 -0800 Subject: [PATCH 1/9] init pr --- .../sgv2/jsonapi/exception/ErrorCode.java | 10 ++++++- .../jsonapi/exception/JsonApiException.java | 6 ++-- .../mappers/ThrowableToErrorMapper.java | 29 +++++++++---------- 3 files changed, 26 insertions(+), 19 deletions(-) diff --git a/src/main/java/io/stargate/sgv2/jsonapi/exception/ErrorCode.java b/src/main/java/io/stargate/sgv2/jsonapi/exception/ErrorCode.java index 88a124f0e7..2d59ad3b56 100644 --- a/src/main/java/io/stargate/sgv2/jsonapi/exception/ErrorCode.java +++ b/src/main/java/io/stargate/sgv2/jsonapi/exception/ErrorCode.java @@ -130,7 +130,11 @@ public enum ErrorCode { VECTORIZE_SERVICE_TYPE_UNAVAILABLE("Vectorize service unavailable : "), VECTORIZE_USAGE_ERROR("Vectorize search can't be used with other sort clause"), - VECTORIZECONFIG_CHECK_FAIL("Internal server error: VectorizeConfig check fail"); + VECTORIZECONFIG_CHECK_FAIL("Internal server error: VectorizeConfig check fail"), + + UNAUTHORIZED_REQUEST("UNAUTHENTICATED: Invalid token"), + INVALID_QUERY("INVALID QUERY"), + OPERATION_TIMEOUT("OPERATION_TIMEOUT"); private final String message; @@ -145,4 +149,8 @@ public String getMessage() { public JsonApiException toApiException(String format, Object... args) { return new JsonApiException(this, message + ": " + String.format(format, args)); } + + public JsonApiException toApiException() { + return new JsonApiException(this, message); + } } diff --git a/src/main/java/io/stargate/sgv2/jsonapi/exception/JsonApiException.java b/src/main/java/io/stargate/sgv2/jsonapi/exception/JsonApiException.java index f67784ab27..0ddfba150c 100644 --- a/src/main/java/io/stargate/sgv2/jsonapi/exception/JsonApiException.java +++ b/src/main/java/io/stargate/sgv2/jsonapi/exception/JsonApiException.java @@ -48,7 +48,7 @@ public CommandResult get() { } // construct and return - CommandResult.Error error = getCommandResultError(message); + CommandResult.Error error = getCommandResultError(message, Response.Status.OK); // handle cause as well Throwable cause = getCause(); @@ -60,7 +60,7 @@ public CommandResult get() { } } - public CommandResult.Error getCommandResultError(String message) { + public CommandResult.Error getCommandResultError(String message, Response.Status status) { Map fieldsForMetricsTag = Map.of("errorCode", errorCode.name(), "exceptionClass", this.getClass().getSimpleName()); SmallRyeConfig config = ConfigProvider.getConfig().unwrap(SmallRyeConfig.class); @@ -72,7 +72,7 @@ public CommandResult.Error getCommandResultError(String message) { ? Map.of( "errorCode", errorCode.name(), "exceptionClass", this.getClass().getSimpleName()) : Map.of("errorCode", errorCode.name()); - return new CommandResult.Error(message, fieldsForMetricsTag, fields, Response.Status.OK); + return new CommandResult.Error(message, fieldsForMetricsTag, fields, status); } public ErrorCode getErrorCode() { diff --git a/src/main/java/io/stargate/sgv2/jsonapi/exception/mappers/ThrowableToErrorMapper.java b/src/main/java/io/stargate/sgv2/jsonapi/exception/mappers/ThrowableToErrorMapper.java index fa00dc406d..a901844447 100644 --- a/src/main/java/io/stargate/sgv2/jsonapi/exception/mappers/ThrowableToErrorMapper.java +++ b/src/main/java/io/stargate/sgv2/jsonapi/exception/mappers/ThrowableToErrorMapper.java @@ -30,7 +30,7 @@ public final class ThrowableToErrorMapper { (throwable, message) -> { // if our own exception, shortcut if (throwable instanceof JsonApiException jae) { - return jae.getCommandResultError(message); + return jae.getCommandResultError(message, Response.Status.OK); } // Override response error code SmallRyeConfig config = ConfigProvider.getConfig().unwrap(SmallRyeConfig.class); @@ -43,21 +43,22 @@ public final class ThrowableToErrorMapper { if (throwable instanceof UnauthorizedException || throwable instanceof com.datastax.oss.driver.api.core.servererrors.UnauthorizedException) { - return new CommandResult.Error( - "UNAUTHENTICATED: Invalid token", - fieldsForMetricsTag, - fields, - Response.Status.UNAUTHORIZED); + return ErrorCode.UNAUTHORIZED_REQUEST + .toApiException() + .getCommandResultError(message, Response.Status.UNAUTHORIZED); } else if (throwable instanceof QueryValidationException) { - if (message.contains("vector> nodewiseErrors = @@ -83,11 +84,9 @@ public final class ThrowableToErrorMapper { .getMessage() .contains( "Provided username token and/or password are incorrect")))) { - return new CommandResult.Error( - "UNAUTHENTICATED: Invalid token", - fieldsForMetricsTag, - fields, - Response.Status.UNAUTHORIZED); + return ErrorCode.UNAUTHORIZED_REQUEST + .toApiException() + .getCommandResultError(message, Response.Status.UNAUTHORIZED); } } } From 8e68a8b451a84812bfeba55f2fa0ac8043f4dfa2 Mon Sep 17 00:00:00 2001 From: Yuqi Du Date: Thu, 1 Feb 2024 11:36:17 -0800 Subject: [PATCH 2/9] add mapping --- .../sgv2/jsonapi/exception/ErrorCode.java | 6 +- .../mappers/ThrowableToErrorMapper.java | 84 ++++++++++++------- 2 files changed, 57 insertions(+), 33 deletions(-) diff --git a/src/main/java/io/stargate/sgv2/jsonapi/exception/ErrorCode.java b/src/main/java/io/stargate/sgv2/jsonapi/exception/ErrorCode.java index 2d59ad3b56..c713da8cbb 100644 --- a/src/main/java/io/stargate/sgv2/jsonapi/exception/ErrorCode.java +++ b/src/main/java/io/stargate/sgv2/jsonapi/exception/ErrorCode.java @@ -133,8 +133,10 @@ public enum ErrorCode { VECTORIZECONFIG_CHECK_FAIL("Internal server error: VectorizeConfig check fail"), UNAUTHORIZED_REQUEST("UNAUTHENTICATED: Invalid token"), - INVALID_QUERY("INVALID QUERY"), - OPERATION_TIMEOUT("OPERATION_TIMEOUT"); + INVALID_QUERY("Invalid query"), + DRIVER_TIMEOUT("Driver timeout on"), + DRIVER_CLOSED_CONNECTION("Driver request connection is closed due to an unrelated event"), + NO_NODE_AVAILABLE("No node was available to execute the query"); private final String message; diff --git a/src/main/java/io/stargate/sgv2/jsonapi/exception/mappers/ThrowableToErrorMapper.java b/src/main/java/io/stargate/sgv2/jsonapi/exception/mappers/ThrowableToErrorMapper.java index a901844447..c4cf675bdb 100644 --- a/src/main/java/io/stargate/sgv2/jsonapi/exception/mappers/ThrowableToErrorMapper.java +++ b/src/main/java/io/stargate/sgv2/jsonapi/exception/mappers/ThrowableToErrorMapper.java @@ -3,7 +3,9 @@ import com.datastax.oss.driver.api.core.AllNodesFailedException; import com.datastax.oss.driver.api.core.DriverException; import com.datastax.oss.driver.api.core.DriverTimeoutException; +import com.datastax.oss.driver.api.core.NoNodeAvailableException; import com.datastax.oss.driver.api.core.auth.AuthenticationException; +import com.datastax.oss.driver.api.core.connection.ClosedConnectionException; import com.datastax.oss.driver.api.core.metadata.Node; import com.datastax.oss.driver.api.core.servererrors.QueryValidationException; import com.datastax.oss.driver.api.core.servererrors.ReadTimeoutException; @@ -32,7 +34,8 @@ public final class ThrowableToErrorMapper { if (throwable instanceof JsonApiException jae) { return jae.getCommandResultError(message, Response.Status.OK); } - // Override response error code + + // construct fieldsForMetricsTag, only expose exceptionClass in debugMode SmallRyeConfig config = ConfigProvider.getConfig().unwrap(SmallRyeConfig.class); DebugModeConfig debugModeConfig = config.getConfigMapping(DebugModeConfig.class); final boolean debugEnabled = debugModeConfig.enabled(); @@ -40,12 +43,15 @@ public final class ThrowableToErrorMapper { debugEnabled ? Map.of("exceptionClass", throwable.getClass().getSimpleName()) : null; final Map fieldsForMetricsTag = Map.of("exceptionClass", throwable.getClass().getSimpleName()); + + // Authentication Failure -> ErrorCode.UNAUTHORIZED_REQUEST if (throwable instanceof UnauthorizedException || throwable instanceof com.datastax.oss.driver.api.core.servererrors.UnauthorizedException) { return ErrorCode.UNAUTHORIZED_REQUEST .toApiException() .getCommandResultError(message, Response.Status.UNAUTHORIZED); + // Driver QueryValidationException -> ErrorCode.INVALID_QUERY } else if (throwable instanceof QueryValidationException) { if (message.contains("vector ErrorCode.OPERATION_TIMEOUT } else if (throwable instanceof DriverTimeoutException || throwable instanceof WriteTimeoutException || throwable instanceof ReadTimeoutException) { - return ErrorCode.OPERATION_TIMEOUT + return ErrorCode.DRIVER_TIMEOUT .toApiException() .getCommandResultError(message, Response.Status.OK); - } else if (throwable instanceof DriverException) { - if (throwable instanceof AllNodesFailedException) { - Map> nodewiseErrors = - ((AllNodesFailedException) throwable).getAllErrors(); - if (!nodewiseErrors.isEmpty()) { - List errors = nodewiseErrors.values().iterator().next(); - if (errors != null && !errors.isEmpty()) { - Throwable error = - errors.stream() - .findAny() - .filter( - t -> - t instanceof AuthenticationException - || t instanceof IllegalArgumentException) - .orElse(null); - // connecting to oss cassandra throws AuthenticationException for invalid - // credentials connecting to AstraDB throws IllegalArgumentException for invalid - // token/credentials - if (error instanceof AuthenticationException - || (error instanceof IllegalArgumentException - && (error.getMessage().contains("AUTHENTICATION ERROR") - || error - .getMessage() - .contains( - "Provided username token and/or password are incorrect")))) { - return ErrorCode.UNAUTHORIZED_REQUEST - .toApiException() - .getCommandResultError(message, Response.Status.UNAUTHORIZED); - } + // Driver AllNodesFailedException a composite exception + // peeling the errors from it + } else if (throwable instanceof AllNodesFailedException) { + Map> nodewiseErrors = + ((AllNodesFailedException) throwable).getAllErrors(); + // will not give clients AllNodesFailedException error + if (!nodewiseErrors.isEmpty()) { + List errors = nodewiseErrors.values().iterator().next(); + if (errors != null && !errors.isEmpty()) { + Throwable error = + errors.stream() + .findAny() + .filter( + t -> + t instanceof AuthenticationException + || t instanceof IllegalArgumentException + || t instanceof NoNodeAvailableException) + .orElse(null); + // connect to oss cassandra throws AuthenticationException for invalid credentials + // connect to AstraDB throws IllegalArgumentException for invalid token/credentials + if (error instanceof AuthenticationException + || (error instanceof IllegalArgumentException + && (error.getMessage().contains("AUTHENTICATION ERROR") + || error + .getMessage() + .contains( + "Provided username token and/or password are incorrect")))) { + return ErrorCode.UNAUTHORIZED_REQUEST + .toApiException() + .getCommandResultError(message, Response.Status.UNAUTHORIZED); + // Driver NoNodeAvailableException -> ErrorCode.NO_NODE_AVAILABLE + } else if (error instanceof NoNodeAvailableException) { + return ErrorCode.NO_NODE_AVAILABLE + .toApiException() + .getCommandResultError(message, Response.Status.OK); } } } + // Driver ClosedConnectionException -> ErrorCode.DRIVER_CLOSED_CONNECTION + } else if (throwable instanceof ClosedConnectionException) { + return ErrorCode.DRIVER_CLOSED_CONNECTION + .toApiException() + .getCommandResultError(message, Response.Status.OK); + // Unidentified Driver Exceptions, will not mapper into JsonApiException + } else if (throwable instanceof DriverException) { return new CommandResult.Error( message, fieldsForMetricsTag, fields, Response.Status.INTERNAL_SERVER_ERROR); } + + // Errors not from driver and JsonApiException return new CommandResult.Error(message, fieldsForMetricsTag, fields, Response.Status.OK); }; From cfa04f429cb59e39e6e9e201f2f688e57f760c64 Mon Sep 17 00:00:00 2001 From: Yuqi Du Date: Thu, 1 Feb 2024 13:04:54 -0800 Subject: [PATCH 3/9] UNAUTHENTICATED_REQUEST --- .../java/io/stargate/sgv2/jsonapi/exception/ErrorCode.java | 2 +- .../jsonapi/exception/mappers/ThrowableToErrorMapper.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/io/stargate/sgv2/jsonapi/exception/ErrorCode.java b/src/main/java/io/stargate/sgv2/jsonapi/exception/ErrorCode.java index c713da8cbb..7336b46d08 100644 --- a/src/main/java/io/stargate/sgv2/jsonapi/exception/ErrorCode.java +++ b/src/main/java/io/stargate/sgv2/jsonapi/exception/ErrorCode.java @@ -132,7 +132,7 @@ public enum ErrorCode { VECTORIZECONFIG_CHECK_FAIL("Internal server error: VectorizeConfig check fail"), - UNAUTHORIZED_REQUEST("UNAUTHENTICATED: Invalid token"), + UNAUTHENTICATED_REQUEST("UNAUTHENTICATED: Invalid token"), INVALID_QUERY("Invalid query"), DRIVER_TIMEOUT("Driver timeout on"), DRIVER_CLOSED_CONNECTION("Driver request connection is closed due to an unrelated event"), diff --git a/src/main/java/io/stargate/sgv2/jsonapi/exception/mappers/ThrowableToErrorMapper.java b/src/main/java/io/stargate/sgv2/jsonapi/exception/mappers/ThrowableToErrorMapper.java index c4cf675bdb..b33a8633a0 100644 --- a/src/main/java/io/stargate/sgv2/jsonapi/exception/mappers/ThrowableToErrorMapper.java +++ b/src/main/java/io/stargate/sgv2/jsonapi/exception/mappers/ThrowableToErrorMapper.java @@ -48,7 +48,7 @@ public final class ThrowableToErrorMapper { if (throwable instanceof UnauthorizedException || throwable instanceof com.datastax.oss.driver.api.core.servererrors.UnauthorizedException) { - return ErrorCode.UNAUTHORIZED_REQUEST + return ErrorCode.UNAUTHENTICATED_REQUEST .toApiException() .getCommandResultError(message, Response.Status.UNAUTHORIZED); // Driver QueryValidationException -> ErrorCode.INVALID_QUERY @@ -93,7 +93,7 @@ public final class ThrowableToErrorMapper { .getMessage() .contains( "Provided username token and/or password are incorrect")))) { - return ErrorCode.UNAUTHORIZED_REQUEST + return ErrorCode.UNAUTHENTICATED_REQUEST .toApiException() .getCommandResultError(message, Response.Status.UNAUTHORIZED); // Driver NoNodeAvailableException -> ErrorCode.NO_NODE_AVAILABLE From 6939fda592a2969bd44b3daa0a33f45ac781806d Mon Sep 17 00:00:00 2001 From: Yuqi Du Date: Thu, 1 Feb 2024 13:37:14 -0800 Subject: [PATCH 4/9] fix --- .../sgv2/jsonapi/exception/mappers/ThrowableToErrorMapper.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/main/java/io/stargate/sgv2/jsonapi/exception/mappers/ThrowableToErrorMapper.java b/src/main/java/io/stargate/sgv2/jsonapi/exception/mappers/ThrowableToErrorMapper.java index b33a8633a0..5a30059e27 100644 --- a/src/main/java/io/stargate/sgv2/jsonapi/exception/mappers/ThrowableToErrorMapper.java +++ b/src/main/java/io/stargate/sgv2/jsonapi/exception/mappers/ThrowableToErrorMapper.java @@ -71,7 +71,6 @@ public final class ThrowableToErrorMapper { } else if (throwable instanceof AllNodesFailedException) { Map> nodewiseErrors = ((AllNodesFailedException) throwable).getAllErrors(); - // will not give clients AllNodesFailedException error if (!nodewiseErrors.isEmpty()) { List errors = nodewiseErrors.values().iterator().next(); if (errors != null && !errors.isEmpty()) { @@ -115,7 +114,6 @@ public final class ThrowableToErrorMapper { message, fieldsForMetricsTag, fields, Response.Status.INTERNAL_SERVER_ERROR); } - // Errors not from driver and JsonApiException return new CommandResult.Error(message, fieldsForMetricsTag, fields, Response.Status.OK); }; From 6b26ceeb1c8d43e1c9e3eb6627aba6283145f638 Mon Sep 17 00:00:00 2001 From: Yuqi Du Date: Thu, 1 Feb 2024 13:55:41 -0800 Subject: [PATCH 5/9] return UNAUTHENTICATED_REQUEST msg --- .../jsonapi/exception/mappers/ThrowableToErrorMapper.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main/java/io/stargate/sgv2/jsonapi/exception/mappers/ThrowableToErrorMapper.java b/src/main/java/io/stargate/sgv2/jsonapi/exception/mappers/ThrowableToErrorMapper.java index 5a30059e27..1fc29ad53f 100644 --- a/src/main/java/io/stargate/sgv2/jsonapi/exception/mappers/ThrowableToErrorMapper.java +++ b/src/main/java/io/stargate/sgv2/jsonapi/exception/mappers/ThrowableToErrorMapper.java @@ -50,7 +50,8 @@ public final class ThrowableToErrorMapper { instanceof com.datastax.oss.driver.api.core.servererrors.UnauthorizedException) { return ErrorCode.UNAUTHENTICATED_REQUEST .toApiException() - .getCommandResultError(message, Response.Status.UNAUTHORIZED); + .getCommandResultError( + ErrorCode.UNAUTHENTICATED_REQUEST.getMessage(), Response.Status.UNAUTHORIZED); // Driver QueryValidationException -> ErrorCode.INVALID_QUERY } else if (throwable instanceof QueryValidationException) { if (message.contains("vector ErrorCode.NO_NODE_AVAILABLE } else if (error instanceof NoNodeAvailableException) { return ErrorCode.NO_NODE_AVAILABLE From 2672bc34c39a1f974bb8f37223e72af6998ef00e Mon Sep 17 00:00:00 2001 From: Yuqi Du Date: Thu, 1 Feb 2024 14:59:34 -0800 Subject: [PATCH 6/9] invalid query --- .../sgv2/jsonapi/api/v1/VectorSearchIntegrationTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/java/io/stargate/sgv2/jsonapi/api/v1/VectorSearchIntegrationTest.java b/src/test/java/io/stargate/sgv2/jsonapi/api/v1/VectorSearchIntegrationTest.java index 3184702119..15473eb0df 100644 --- a/src/test/java/io/stargate/sgv2/jsonapi/api/v1/VectorSearchIntegrationTest.java +++ b/src/test/java/io/stargate/sgv2/jsonapi/api/v1/VectorSearchIntegrationTest.java @@ -872,7 +872,7 @@ public void failWithZerosVector() { .statusCode(200) .body("errors", is(notNullValue())) .body("errors", hasSize(1)) - .body("errors[0].errorCode", is("INVALID_REQUEST")) + .body("errors[0].errorCode", is("INVALID_QUERY")) .body( "errors[0].message", endsWith("Zero vectors cannot be indexed or queried with cosine similarity")); From 2f0cb3672d73b38d05f5e0005b03a10e837c69f2 Mon Sep 17 00:00:00 2001 From: Yuqi Du Date: Mon, 5 Feb 2024 18:26:40 -0800 Subject: [PATCH 7/9] fix --- src/main/java/io/stargate/sgv2/jsonapi/exception/ErrorCode.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/io/stargate/sgv2/jsonapi/exception/ErrorCode.java b/src/main/java/io/stargate/sgv2/jsonapi/exception/ErrorCode.java index 7336b46d08..683aca8034 100644 --- a/src/main/java/io/stargate/sgv2/jsonapi/exception/ErrorCode.java +++ b/src/main/java/io/stargate/sgv2/jsonapi/exception/ErrorCode.java @@ -134,7 +134,7 @@ public enum ErrorCode { UNAUTHENTICATED_REQUEST("UNAUTHENTICATED: Invalid token"), INVALID_QUERY("Invalid query"), - DRIVER_TIMEOUT("Driver timeout on"), + DRIVER_TIMEOUT("Driver timeout"), DRIVER_CLOSED_CONNECTION("Driver request connection is closed due to an unrelated event"), NO_NODE_AVAILABLE("No node was available to execute the query"); From a1542eef6d7c2160690c18fabf40b193db6d5373 Mon Sep 17 00:00:00 2001 From: Yuqi Du Date: Wed, 14 Feb 2024 08:53:52 -0800 Subject: [PATCH 8/9] 200->500 --- .../jsonapi/exception/mappers/ThrowableToErrorMapper.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/io/stargate/sgv2/jsonapi/exception/mappers/ThrowableToErrorMapper.java b/src/main/java/io/stargate/sgv2/jsonapi/exception/mappers/ThrowableToErrorMapper.java index 1fc29ad53f..5ef8793d6e 100644 --- a/src/main/java/io/stargate/sgv2/jsonapi/exception/mappers/ThrowableToErrorMapper.java +++ b/src/main/java/io/stargate/sgv2/jsonapi/exception/mappers/ThrowableToErrorMapper.java @@ -66,7 +66,7 @@ public final class ThrowableToErrorMapper { || throwable instanceof ReadTimeoutException) { return ErrorCode.DRIVER_TIMEOUT .toApiException() - .getCommandResultError(message, Response.Status.OK); + .getCommandResultError(message, Response.Status.INTERNAL_SERVER_ERROR); // Driver AllNodesFailedException a composite exception // peeling the errors from it } else if (throwable instanceof AllNodesFailedException) { @@ -102,7 +102,7 @@ public final class ThrowableToErrorMapper { } else if (error instanceof NoNodeAvailableException) { return ErrorCode.NO_NODE_AVAILABLE .toApiException() - .getCommandResultError(message, Response.Status.OK); + .getCommandResultError(message, Response.Status.INTERNAL_SERVER_ERROR); } } } @@ -110,7 +110,7 @@ public final class ThrowableToErrorMapper { } else if (throwable instanceof ClosedConnectionException) { return ErrorCode.DRIVER_CLOSED_CONNECTION .toApiException() - .getCommandResultError(message, Response.Status.OK); + .getCommandResultError(message, Response.Status.INTERNAL_SERVER_ERROR); // Unidentified Driver Exceptions, will not mapper into JsonApiException } else if (throwable instanceof DriverException) { return new CommandResult.Error( From e75cbe343d5b13bfd1923d0fde36094445a25d55 Mon Sep 17 00:00:00 2001 From: Yuqi Du Date: Wed, 14 Feb 2024 10:27:38 -0800 Subject: [PATCH 9/9] modify error msg --- src/main/java/io/stargate/sgv2/jsonapi/exception/ErrorCode.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/io/stargate/sgv2/jsonapi/exception/ErrorCode.java b/src/main/java/io/stargate/sgv2/jsonapi/exception/ErrorCode.java index 683aca8034..172815ded0 100644 --- a/src/main/java/io/stargate/sgv2/jsonapi/exception/ErrorCode.java +++ b/src/main/java/io/stargate/sgv2/jsonapi/exception/ErrorCode.java @@ -135,7 +135,7 @@ public enum ErrorCode { UNAUTHENTICATED_REQUEST("UNAUTHENTICATED: Invalid token"), INVALID_QUERY("Invalid query"), DRIVER_TIMEOUT("Driver timeout"), - DRIVER_CLOSED_CONNECTION("Driver request connection is closed due to an unrelated event"), + DRIVER_CLOSED_CONNECTION("Driver request connection is closed"), NO_NODE_AVAILABLE("No node was available to execute the query"); private final String message;