Uhh status is set for all instances we are expecting a 0 status code from kill to ensure that the process has been killed if the first if statement is run and is == -1 then status is already set with -1 and we only update status to a success if SIGTERM or SIGKILL work the first if in this block the kill(pid, 0) == 0 is a SIGNULL to see if the process in question is still running. So I don't see the incentive of using exceptions in this case? a non 0 status code from the function gives us all the debug info we really need?