From a1ec175c05935d5113fc988bab766c1e00f2c75a Mon Sep 17 00:00:00 2001 From: Michael <3533648+hertg@users.noreply.github.com> Date: Fri, 23 Sep 2022 21:33:22 +0200 Subject: [PATCH] print error message if sysfs read doesn't work --- internal/pci/pci.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/internal/pci/pci.go b/internal/pci/pci.go index 355ebf7..fa14807 100644 --- a/internal/pci/pci.go +++ b/internal/pci/pci.go @@ -7,6 +7,7 @@ import ( "strings" "github.com/fatih/color" + "github.com/hertg/egpu-switcher/internal/logger" "github.com/hertg/gopci/pkg/pci" ) @@ -93,6 +94,7 @@ func ReadGPUs() []*GPU { } devices, err := pci.Scan(gpuFilter) if err != nil { + logger.Error("unable to read pci information from sysfs: %s", err) panic("unable to read pci information from sysfs") } var gpus []*GPU