【发布时间】:2021-12-04 00:32:22
【问题描述】:
这个错误是什么意思?
错误:13 内部:收到代码为 0 的 RST_STREAM
【问题讨论】:
标签: javascript node.js hedera-hashgraph
这个错误是什么意思?
错误:13 内部:收到代码为 0 的 RST_STREAM
【问题讨论】:
标签: javascript node.js hedera-hashgraph
目前,如果您覆盖 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");
}
}
}
这样,如果其他节点没有响应,你会很好地处理它。
【讨论】: