'Runs a callback with error handling.
For use in subclasses.'

def _run_callback(self, callback):

    try:
        ret = callback()
        if ((ret is not None) and is_future(ret)):
            self.add_future(ret, (lambda f: f.result()))
    except Exception:
        self.handle_callback_exception(callback)
