Add more error handling to EventPump