From 3fdb83a2eed3bd1aa21d1896f6e981476e64e97c Mon Sep 17 00:00:00 2001
From: Valentin Rothberg <rothberg@redhat.com>
Date: Mon, 21 Sep 2020 09:45:19 +0200
Subject: stats: log errors instead of sending 500

As 200 is already out the door, we cannot send 500s anymore.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
---
 pkg/api/handlers/compat/containers_stats.go | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

(limited to 'pkg/api')

diff --git a/pkg/api/handlers/compat/containers_stats.go b/pkg/api/handlers/compat/containers_stats.go
index d3f9b7c41..16bd0518a 100644
--- a/pkg/api/handlers/compat/containers_stats.go
+++ b/pkg/api/handlers/compat/containers_stats.go
@@ -95,28 +95,28 @@ streamLabel: // A label to flatten the scope
 		// Container stats
 		stats, err := ctnr.GetContainerStats(stats)
 		if err != nil {
-			utils.InternalServerError(w, err)
+			logrus.Errorf("Unable to get container stats: %v", err)
 			return
 		}
 		inspect, err := ctnr.Inspect(false)
 		if err != nil {
-			utils.InternalServerError(w, err)
+			logrus.Errorf("Unable to inspect container: %v", err)
 			return
 		}
 		// Cgroup stats
 		cgroupPath, err := ctnr.CGroupPath()
 		if err != nil {
-			utils.InternalServerError(w, err)
+			logrus.Errorf("Unable to get cgroup path of container: %v", err)
 			return
 		}
 		cgroup, err := cgroups.Load(cgroupPath)
 		if err != nil {
-			utils.InternalServerError(w, err)
+			logrus.Errorf("Unable to load cgroup: %v", err)
 			return
 		}
 		cgroupStat, err := cgroup.Stat()
 		if err != nil {
-			utils.InternalServerError(w, err)
+			logrus.Errorf("Unable to get cgroup stats: %v", err)
 			return
 		}
 
@@ -192,7 +192,7 @@ streamLabel: // A label to flatten the scope
 		}
 
 		if err := coder.Encode(s); err != nil {
-			utils.InternalServerError(w, err)
+			logrus.Errorf("Unable to encode stats: %v", err)
 			return
 		}
 		if flusher, ok := w.(http.Flusher); ok {
-- 
cgit v1.2.3-54-g00ecf