迁移后API地址确认页面提示更详细的API节点配置错误

This commit is contained in:
GoEdgeLab
2023-06-10 16:31:20 +08:00
parent c066498981
commit 03a70e1aed
2 changed files with 75 additions and 62 deletions

View File

@@ -80,12 +80,14 @@ func (this *IndexAction) RunPost(params struct {
config.RPC.Endpoints = []string{endpoint}
client, err := rpc.NewRPCClient(config, false)
if err != nil {
this.Fail("无法连接到API节点地址'" + endpoint + "'" + err.Error())
actionutils.Fail(this, err)
return
}
_, err = client.APINodeRPC().FindCurrentAPINodeVersion(client.Context(0), &pb.FindCurrentAPINodeVersionRequest{})
if err != nil {
_ = client.Close()
this.Fail("无法连接到API节点地址'" + endpoint + "'" + err.Error())
actionutils.Fail(this, err)
return
}
_ = client.Close()