From 543555da53cab447884859115327b9337a5a7b32 Mon Sep 17 00:00:00 2001 From: Savannah Ostrowski Date: Wed, 10 May 2023 18:57:41 -0700 Subject: [PATCH] Better error handling for killing ports --- main.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/main.go b/main.go index 93dfbfd..22674fc 100644 --- a/main.go +++ b/main.go @@ -206,11 +206,11 @@ func getProcesses() []list.Item { func killPort(pid string) { pidInt, err := strconv.Atoi(pid) if err != nil { - log.Error("Could not convert to process pid to int") + log.Error("Could not convert to process pid to int - ", err) } - syscall.Kill(pidInt, syscall.SIGKILL) - if err != nil { - log.Error("Could not kill process") + + if err := syscall.Kill(pidInt, syscall.SIGKILL); err != nil { + log.Error("Could not kill process - ", err) } }