General error handling

We used to only get PID's not found (not a real error). Now we're getting nil issues. Putting in general error handling and output to log so that it can be looked at in greater detail with stack trace.