Improve TCP error reporting interface