Wrap errors in the Go 1.13 way
Signed-off-by: Julian Kornberger <jk+github@digineo.de>
This commit is contained in:
parent
da0ae76a91
commit
043fecbfd8
21 changed files with 31 additions and 31 deletions
|
|
@ -36,7 +36,7 @@ type bcacheCollector struct {
|
|||
func NewBcacheCollector() (Collector, error) {
|
||||
fs, err := bcache.NewFS(*sysPath)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to open sysfs: %v", err)
|
||||
return nil, fmt.Errorf("failed to open sysfs: %w", err)
|
||||
}
|
||||
|
||||
return &bcacheCollector{
|
||||
|
|
@ -49,7 +49,7 @@ func NewBcacheCollector() (Collector, error) {
|
|||
func (c *bcacheCollector) Update(ch chan<- prometheus.Metric) error {
|
||||
stats, err := c.fs.Stats()
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to retrieve bcache stats: %v", err)
|
||||
return fmt.Errorf("failed to retrieve bcache stats: %w", err)
|
||||
}
|
||||
|
||||
for _, s := range stats {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue