Rename RpcNodeUnhealthy error to NodeUnhealthy, generalize getHealth RPC error object for the future (#14656)

(cherry picked from commit 5d9dc609b1)

Co-authored-by: Michael Vines <mvines@gmail.com>
This commit is contained in:
mergify[bot]
2021-01-19 05:24:29 +00:00
committed by GitHub
parent e56681a2f6
commit 061965e291
6 changed files with 45 additions and 22 deletions

View File

@@ -1294,7 +1294,9 @@ None
#### Results:
If the node is healthy: "ok"
If the node is unhealthy, a JSON RPC error response is returned indicating how far behind the node is.
If the node is unhealthy, a JSON RPC error response is returned. The specifics
of the error response are **UNSTABLE** and may change in the future
#### Example:
@@ -1310,13 +1312,26 @@ Healthy Result:
{"jsonrpc":"2.0","result": "ok","id":1}
```
Unhealthy Result:
Unhealthy Result (generic):
```json
{
"jsonrpc": "2.0",
"error": {
"code": -32005,
"message": "RPC node is behind by 42 slots",
"message": "Node is unhealthy",
"data": {}
},
"id": 1
}
```
Unhealthy Result (if additional information is available)
```json
{
"jsonrpc": "2.0",
"error": {
"code": -32005,
"message": "Node is behind by 42 slots",
"data": {
"numSlotsBehind": 42
}