From 3a13a41a15b638571854c24616da6dbe9d2566b6 Mon Sep 17 00:00:00 2001 From: Thomas Roehl Date: Fri, 26 Nov 2021 19:01:47 +0100 Subject: [PATCH] Catch panic in Nvidia Go Bindings --- collectors/nvidiaMetric.go | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/collectors/nvidiaMetric.go b/collectors/nvidiaMetric.go index 5709df7..4597610 100644 --- a/collectors/nvidiaMetric.go +++ b/collectors/nvidiaMetric.go @@ -21,14 +21,11 @@ type NvidiaCollector struct { config NvidiaCollectorConfig } -func (m *NvidiaCollector) CatchPanic() error { - +func (m *NvidiaCollector) CatchPanic() { if rerr := recover(); rerr != nil { - log.Print("CatchPanic ", string(rerr.(string))) - err := errors.New(rerr.(string)) - return err + log.Print(rerr) + m.init = false } - return nil } func (m *NvidiaCollector) Init(config []byte) error {