mirror of
https://github.com/kubernetes/client-go.git
synced 2025-10-22 06:26:40 +00:00
Clients are required to handle watch events of type ERROR, so instead of eating the decoding error we should pass it on to the client. Use NewGenericServerError with isUnexpectedResponse to indicate that we didn't get the bytes from the server we were expecting. For watch, the 415 error code is roughly correct and we will return an error to the client that makes debugging a failure in either server watch or client machinery much easier. We do not alter the behavior when it appears the response is an EOF or other disconnection. Kubernetes-commit: 89620d5667adec6c132b2713b79efb1dd2391723