Add error logging to process forking