Skip to content

Commit

Permalink
Better error handling for killing ports
Browse files Browse the repository at this point in the history
  • Loading branch information
savannahostrowski committed May 11, 2023
1 parent 5670227 commit 543555d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}

Expand Down

0 comments on commit 543555d

Please sign in to comment.