diff --git a/proxyd/backend.go b/proxyd/backend.go index 793c86c..3d0c62c 100644 --- a/proxyd/backend.go +++ b/proxyd/backend.go @@ -56,7 +56,7 @@ var ( } ErrNoBackends = &RPCErr{ Code: JSONRPCErrorInternal - 11, - Message: "no backends available for method", + Message: "no backend is currently healthy to serve traffic", HTTPErrorCode: 503, } ErrBackendOverCapacity = &RPCErr{ diff --git a/proxyd/integration_tests/batching_test.go b/proxyd/integration_tests/batching_test.go index c1f8b38..af27307 100644 --- a/proxyd/integration_tests/batching_test.go +++ b/proxyd/integration_tests/batching_test.go @@ -66,8 +66,8 @@ func TestBatching(t *testing.T) { NewRPCReq("2", "eth_chainId", nil), }, expectedRes: asArray( - `{"error":{"code":-32011,"message":"no backends available for method"},"id":1,"jsonrpc":"2.0"}`, - `{"error":{"code":-32011,"message":"no backends available for method"},"id":2,"jsonrpc":"2.0"}`, + `{"error":{"code":-32011,"message":"no backend is currently healthy to serve traffic"},"id":1,"jsonrpc":"2.0"}`, + `{"error":{"code":-32011,"message":"no backend is currently healthy to serve traffic"},"id":2,"jsonrpc":"2.0"}`, ), maxUpstreamBatchSize: 10, numExpectedForwards: 1, @@ -80,8 +80,8 @@ func TestBatching(t *testing.T) { NewRPCReq("2", "eth_chainId", nil), }, expectedRes: asArray( - `{"error":{"code":-32011,"message":"no backends available for method"},"id":1,"jsonrpc":"2.0"}`, - `{"error":{"code":-32011,"message":"no backends available for method"},"id":2,"jsonrpc":"2.0"}`, + `{"error":{"code":-32011,"message":"no backend is currently healthy to serve traffic"},"id":1,"jsonrpc":"2.0"}`, + `{"error":{"code":-32011,"message":"no backend is currently healthy to serve traffic"},"id":2,"jsonrpc":"2.0"}`, ), maxUpstreamBatchSize: 1, numExpectedForwards: 2, diff --git a/proxyd/integration_tests/failover_test.go b/proxyd/integration_tests/failover_test.go index 1d371a6..78252ef 100644 --- a/proxyd/integration_tests/failover_test.go +++ b/proxyd/integration_tests/failover_test.go @@ -15,7 +15,7 @@ import ( const ( goodResponse = `{"jsonrpc": "2.0", "result": "hello", "id": 999}` - noBackendsResponse = `{"error":{"code":-32011,"message":"no backends available for method"},"id":999,"jsonrpc":"2.0"}` + noBackendsResponse = `{"error":{"code":-32011,"message":"no backend is currently healthy to serve traffic"},"id":999,"jsonrpc":"2.0"}` unexpectedResponse = `{"error":{"code":-32011,"message":"some error"},"id":999,"jsonrpc":"2.0"}` ) @@ -110,7 +110,7 @@ func TestFailover(t *testing.T) { })) res, statusCode, _ := client.SendRPC("eth_chainId", nil) require.Equal(t, 503, statusCode) - RequireEqualJSON(t, []byte(noBackendsResponse), res) // return no backend available since both failed + RequireEqualJSON(t, []byte(noBackendsResponse), res) // return currently not healthy since both failed require.Equal(t, 1, len(goodBackend.Requests())) require.Equal(t, 1, len(badBackend.Requests())) // bad backend is still called goodBackend.Reset()