Cleanup error handling
Some checks failed
continuous-integration/drone/tag Build is failing

This commit is contained in:
KemoNine 2020-08-28 20:02:38 -04:00
parent 75a26c064d
commit 255e647c5e

View file

@ -23,11 +23,10 @@ func main() {
// Goroutine to handle os signals (nuke fim so we can get to config ui)
go func() {
for sig := range sigs {
fmt.Println(sig)
for range sigs {
if fim != nil { // Just in case someone lays on ctrl-c or similar during startup
if err := fim.Process.Kill(); err != nil {
log.Fatal("failed to kill process: ", err)
log.Fatalf("failed to kill process: %s", err)
}
}
}
@ -41,7 +40,7 @@ func main() {
// Unwrap the error a bit so we can find out if a signal killed fim or something else
// An exit code of -1 means the program didn't exit in time or was terminated by a signal (per the docs)
if exitError, ok := err.(*exec.ExitError); ok && exitError.ExitCode() != -1 {
log.Fatalf("Error : ", err)
log.Fatalf("Error : %s", err)
}
}