def _transmit_error(self):
        fmt = str(
            '!HH%dsx' %
            (len(self._stats.error['error_message'].encode('latin-1')))
        )
        packet = struct.pack(
            fmt, constants.OPCODE_ERROR, self._stats.error['error_code'],
            bytes(self._stats.error['error_message'].encode('latin-1'))
        )
        self._listener.sendto(packet, self._peer)
Transmits an error to the client and terminates the exchange.
dataset/ETHPy150Open facebook/fbtftp/fbtftp/base_handler.py/BaseHandler._transmit_error