def _async_callback(self, callback, *args, **kwargs):
        if args or kwargs:
            callback = functools.partial(callback, *args, **kwargs)

        def wrapper(*args, **kwargs):
            try:
                return callback(*args, **kwargs)
            except Exception:
                logging.error('Uncaught exception', exc_info=True)
                self._abort()
        return wrapper
Wrap callbacks with this if they are used on asynchronous requests.
dataset/ETHPy150Open jbalogh/tornado-websocket-client/websocket.py/WebSocket._async_callback