mirror of
https://github.com/ClusterCockpit/cc-metric-collector.git
synced 2024-12-26 15:29:04 +01:00
Catch panic in Nvidia Go Bindings
This commit is contained in:
parent
75f5ac8980
commit
3a13a41a15
@ -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 {
|
||||||
|
Loading…
Reference in New Issue
Block a user