Add Exception to TCP and UDP server to handle errors