Add cause to error message
Signed-off-by: Julian Kornberger <jk+github@digineo.de>
This commit is contained in:
parent
043fecbfd8
commit
cafb12dc59
|
@ -18,7 +18,7 @@ package collector
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"encoding/binary"
|
"encoding/binary"
|
||||||
"errors"
|
"fmt"
|
||||||
"net"
|
"net"
|
||||||
"regexp"
|
"regexp"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
@ -32,7 +32,7 @@ func getNetDevStats(ignore *regexp.Regexp, accept *regexp.Regexp) (map[string]ma
|
||||||
|
|
||||||
ifs, err := net.Interfaces()
|
ifs, err := net.Interfaces()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, errors.New("net.Interfaces() failed")
|
return nil, fmt.Errorf("net.Interfaces() failed: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, iface := range ifs {
|
for _, iface := range ifs {
|
||||||
|
|
Loading…
Reference in New Issue