mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-12 20:57:20 +00:00
Merge pull request #722 from smarterclayton/improve_errors
Normalize apiserver error handling of standard errors
This commit is contained in:
@@ -31,6 +31,7 @@ import (
|
||||
|
||||
type WatchHandler struct {
|
||||
storage map[string]RESTStorage
|
||||
codec Codec
|
||||
}
|
||||
|
||||
func getWatchParams(query url.Values) (label, field labels.Selector, resourceVersion uint64) {
|
||||
@@ -66,7 +67,7 @@ func (h *WatchHandler) ServeHTTP(w http.ResponseWriter, req *http.Request) {
|
||||
label, field, resourceVersion := getWatchParams(req.URL.Query())
|
||||
watching, err := watcher.Watch(label, field, resourceVersion)
|
||||
if err != nil {
|
||||
internalError(err, w)
|
||||
errorJSON(err, h.codec, w)
|
||||
return
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user