From 83a3ee55a8e336acdf05ab261032d40aa44583cf Mon Sep 17 00:00:00 2001 From: a10zn8 Date: Fri, 9 Jun 2023 22:24:19 +0400 Subject: [PATCH] fix propagation of error code --- src/main/kotlin/io/emeraldpay/dshackle/rpc/NativeCall.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/kotlin/io/emeraldpay/dshackle/rpc/NativeCall.kt b/src/main/kotlin/io/emeraldpay/dshackle/rpc/NativeCall.kt index 5de542da..b1f091cc 100644 --- a/src/main/kotlin/io/emeraldpay/dshackle/rpc/NativeCall.kt +++ b/src/main/kotlin/io/emeraldpay/dshackle/rpc/NativeCall.kt @@ -615,7 +615,7 @@ open class NativeCall( } fun from(t: Throwable): CallError { return when (t) { - is JsonRpcException -> CallError(t.id.asNumber().toInt(), t.error.message, t.error, getDataAsSting(t.error.details)) + is JsonRpcException -> CallError(t.error.code, t.error.message, t.error, getDataAsSting(t.error.details)) is RpcException -> CallError(t.code, t.rpcMessage, null, getDataAsSting(t.details)) is CallFailure -> CallError(t.id, t.reason.message ?: "Upstream Error", null, null) else -> {