mirror of
https://github.com/prometheus-community/windows_exporter
synced 2025-02-10 16:49:06 +00:00
19 lines
312 B
Go
19 lines
312 B
Go
package perfdata
|
|
|
|
// Error represents error returned from Performance Counters API.
|
|
type Error struct {
|
|
ErrorCode uint32
|
|
errorText string
|
|
}
|
|
|
|
func (m *Error) Error() string {
|
|
return m.errorText
|
|
}
|
|
|
|
func NewPdhError(code uint32) error {
|
|
return &Error{
|
|
ErrorCode: code,
|
|
errorText: PdhFormatError(code),
|
|
}
|
|
}
|