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 1bbffca34a..e17a30cbf9 100644 --- a/src/main/java/io/stargate/sgv2/jsonapi/exception/ErrorCode.java +++ b/src/main/java/io/stargate/sgv2/jsonapi/exception/ErrorCode.java @@ -183,7 +183,9 @@ public enum ErrorCode { SERVER_FAILURE("Driver failed"), SERVER_UNHANDLED_ERROR("Server failed"), INVALID_PARAMETER_VALIDATION_TYPE("Invalid Parameter Validation Type"), - SERVER_EMBEDDING_GATEWAY_NOT_AVAILABLE("Embedding Gateway is not available"); + SERVER_EMBEDDING_GATEWAY_NOT_AVAILABLE("Embedding Gateway is not available"), + EMBEDDING_GATEWAY_ERROR_RATE_LIMIT("Embedding Gateway error rate limit reached for the tenant"), + EMBEDDING_GATEWAY_PROCESSING_ERROR("Embedding Gateway failed to process request"); private final String message; diff --git a/src/main/java/io/stargate/sgv2/jsonapi/service/resolver/model/impl/ValidateCredentials.java b/src/main/java/io/stargate/sgv2/jsonapi/service/resolver/model/impl/ValidateCredentials.java index b2a05a07ce..0424778544 100644 --- a/src/main/java/io/stargate/sgv2/jsonapi/service/resolver/model/impl/ValidateCredentials.java +++ b/src/main/java/io/stargate/sgv2/jsonapi/service/resolver/model/impl/ValidateCredentials.java @@ -46,6 +46,6 @@ public boolean validate(String provider, String value) { } void onStop(@Observes ShutdownEvent ev) { - channel.shutdown(); + if (channel != null) channel.shutdown(); } }