Add cause to error message

Signed-off-by: Julian Kornberger <jk+github@digineo.de>
This commit is contained in:
Julian Kornberger 2019-11-29 16:14:18 +01:00 committed by Johannes 'fish' Ziemke
parent 043fecbfd8
commit cafb12dc59

View File

@ -18,7 +18,7 @@ package collector
import (
"bytes"
"encoding/binary"
"errors"
"fmt"
"net"
"regexp"
"strconv"
@ -32,7 +32,7 @@ func getNetDevStats(ignore *regexp.Regexp, accept *regexp.Regexp) (map[string]ma
ifs, err := net.Interfaces()
if err != nil {
return nil, errors.New("net.Interfaces() failed")
return nil, fmt.Errorf("net.Interfaces() failed: %w", err)
}
for _, iface := range ifs {