Catch panic in Nvidia Go Bindings

This commit is contained in:
Thomas Roehl 2021-11-26 19:01:47 +01:00
parent 75f5ac8980
commit 3a13a41a15

View File

@ -21,14 +21,11 @@ type NvidiaCollector struct {
config NvidiaCollectorConfig config NvidiaCollectorConfig
} }
func (m *NvidiaCollector) CatchPanic() error { func (m *NvidiaCollector) CatchPanic() {
if rerr := recover(); rerr != nil { if rerr := recover(); rerr != nil {
log.Print("CatchPanic ", string(rerr.(string))) log.Print(rerr)
err := errors.New(rerr.(string)) m.init = false
return err
} }
return nil
} }
func (m *NvidiaCollector) Init(config []byte) error { func (m *NvidiaCollector) Init(config []byte) error {