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
}
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 {