From 0f0a5c9425a00de7e8e614f0ad1ccd57e1729908 Mon Sep 17 00:00:00 2001 From: a10zn8 Date: Tue, 6 Jun 2023 19:41:04 +0400 Subject: [PATCH] propagate error from grpc client --- .../dshackle/upstream/rpcclient/JsonRpcGrpcClient.kt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/kotlin/io/emeraldpay/dshackle/upstream/rpcclient/JsonRpcGrpcClient.kt b/src/main/kotlin/io/emeraldpay/dshackle/upstream/rpcclient/JsonRpcGrpcClient.kt index 621948dd..9d83a093 100644 --- a/src/main/kotlin/io/emeraldpay/dshackle/upstream/rpcclient/JsonRpcGrpcClient.kt +++ b/src/main/kotlin/io/emeraldpay/dshackle/upstream/rpcclient/JsonRpcGrpcClient.kt @@ -95,8 +95,9 @@ class JsonRpcGrpcClient( metrics?.fails?.increment() Mono.error( RpcException( - RpcResponseError.CODE_UPSTREAM_CONNECTION_ERROR, - resp.errorMessage + resp.errorCode, + resp.errorMessage, + if (resp.errorData == null || resp.errorData.isEmpty()) null else resp.errorData ) ) }