def write_tw_error(self, msg):
        try:
            obj = { 'cmd': 'error', 'text': msg }
            self.write_message(obj)
        except Exception as ex:
            self.application.twlog.warning('Unable to send error to websocket (%s): %s', msg, ex)
Write a JSON error-reporting command through the socket.
dataset/ETHPy150Open erkyrath/tworld/lib/tweblib/handlers.py/PlayWebSocketHandler.write_tw_error