fix propagation of error code

This commit is contained in:
a10zn8
2023-06-09 22:24:19 +04:00
parent 83fc91c500
commit 83a3ee55a8

View File

@@ -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 -> {