process: fix fallback to V1 collector (#1667)

This commit is contained in:
Jan-Otto Kröpke
2024-10-03 23:44:36 +02:00
committed by GitHub
parent 79baf9921d
commit 2a9a11bd01
5 changed files with 159 additions and 120 deletions

View File

@@ -1,11 +1,26 @@
package perfdata
import "errors"
// Error represents error returned from Performance Counters API.
type Error struct {
ErrorCode uint32
errorText string
}
func (m *Error) Is(err error) bool {
if err == nil {
return false
}
var e *Error
if errors.As(err, &e) {
return m.ErrorCode == e.ErrorCode
}
return false
}
func (m *Error) Error() string {
return m.errorText
}