【问题标题】:JS SDK v2.0.16 Error: 13 INTERNAL: received RST_STREAM with code 0JS SDK v2.0.16 错误:13 内部:收到代码为 0 的 RST_STREAM
【发布时间】:2021-12-04 00:32:22
【问题描述】:

这个错误是什么意思?

错误:13 内部:收到代码为 0 的 RST_STREAM

【问题讨论】:

    标签: javascript node.js hedera-hashgraph


    【解决方案1】:

    目前,如果您覆盖 SDK 的默认节点列表,则有三个端点运行不佳并导致 SDK 无法处理的 RST_STREAM 错误(甚至是 v2.1.1)好的。

    已经在 github 中跟踪此问题:https://github.com/hashgraph/hedera-sdk-js/issues/622

    与此同时,您可以按如下方式处理错误:

    承诺

        let retry = true;
        while (retry) {
            await new AccountBalanceQuery()
                .setAccountId(operatorId)
                .execute(client)
                .then(() => {
                    retry = false;
                    console.log("---> SUCCESS");
                })
                .catch(error => {
                    console.error(error);
                    if (error.message.includes('RST_STREAM')) {
                        console.log("---> RETRY");
                    }
                });
        }
    }
    

    使用 try/catch

        let retry = true;
        while (retry) {
            try {
                await new AccountBalanceQuery()
                    .setAccountId(operatorId)
                    .execute(client);
    
                    retry = false;
                    console.log("---> SUCCESS");
            } catch (error) {
                console.error(error);
                if (error.message.includes('RST_STREAM')) {
                    console.log("---> RETRY");
                }
            }
        }
    

    这样,如果其他节点没有响应,你会很好地处理它。

    【讨论】:

      猜你喜欢
      • 2023-02-17
      • 2022-09-28
      • 2018-06-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-12-31
      相关资源
      最近更新 更多