mirror of
https://github.com/prometheus-community/windows_exporter.git
synced 2026-02-16 01:36:37 +00:00
process: fix fallback to V1 collector (#1667)
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user