From 4e2e1e8c8e04eb0123710a284b290dfdb999afec Mon Sep 17 00:00:00 2001 From: Andrea Cavalli Date: Thu, 24 Oct 2024 03:12:02 +0200 Subject: [PATCH] Fix status code --- .../it/cavallium/rockserver/core/client/GrpcConnection.java | 2 +- .../java/it/cavallium/rockserver/core/server/GrpcServer.java | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/main/java/it/cavallium/rockserver/core/client/GrpcConnection.java b/src/main/java/it/cavallium/rockserver/core/client/GrpcConnection.java index 2bbfa52..dd897be 100644 --- a/src/main/java/it/cavallium/rockserver/core/client/GrpcConnection.java +++ b/src/main/java/it/cavallium/rockserver/core/client/GrpcConnection.java @@ -587,7 +587,7 @@ public class GrpcConnection extends BaseConnection implements RocksDBAPI { var desc = statusRuntimeException.getStatus().getDescription(); var closeIndex = desc.indexOf(']'); var errorCode = desc.substring(grpcRocksDbErrorPrefixString.length(), closeIndex); - var errorDescription = desc.substring(closeIndex + 1); + var errorDescription = desc.substring(closeIndex + 2); return RocksDBException.of(RocksDBErrorType.valueOf(errorCode), errorDescription); } else { return t; diff --git a/src/main/java/it/cavallium/rockserver/core/server/GrpcServer.java b/src/main/java/it/cavallium/rockserver/core/server/GrpcServer.java index 09686a9..3ad2324 100644 --- a/src/main/java/it/cavallium/rockserver/core/server/GrpcServer.java +++ b/src/main/java/it/cavallium/rockserver/core/server/GrpcServer.java @@ -301,7 +301,6 @@ public class GrpcServer extends Server { @Override public Mono putGetChanged(PutRequest request) { return executeSync(() -> { - if(true) throw new RocksDBRetryException(); try (var arena = Arena.ofConfined()) { var changed = api.put(arena, request.getTransactionOrUpdateId(),