Added better error handling for when jenkins is restarting