Add error-handling for WindowsVersion-stuff

This commit is contained in:
Raskaro
2019-08-12 11:50:38 +02:00
parent 0a5981c657
commit 6867a9b174
3 changed files with 33 additions and 1 deletions

16
core/os_windows.go Normal file
View File

@@ -0,0 +1,16 @@
package core
import (
"github.com/safing/portbase/log"
"github.com/safing/portbase/utils/osdetail"
)
// only return on Fatal error!
func startPlatformSpecific() error {
// We can't catch errors when calling WindowsNTVersion() in logging, so we call the function here, just to catch possible errors
if _, err := osdetail.WindowsNTVersion(); err != nil {
log.Errorf("failed to obtain WindowsNTVersion: %s", err)
}
return nil
}