open-vault/helper/hostutil/hostinfo_error.go
Hamid Ghaf 27bb03bbc0
adding copyright header (#19555)
* adding copyright header

* fix fmt and a test
2023-03-15 09:00:52 -07:00

21 lines
400 B
Go

// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0
package hostutil
import "fmt"
// HostInfoError is a typed error for more convenient error checking.
type HostInfoError struct {
Type string
Err error
}
func (e *HostInfoError) WrappedErrors() []error {
return []error{e.Err}
}
func (e *HostInfoError) Error() string {
return fmt.Sprintf("%s: %s", e.Type, e.Err.Error())
}