rescue tcp connection errors