def METHOD_NAME(self, what, *a, **kw):
    try:
        r = what(*a, **kw)
        if isinstance(r, defer.Deferred):
            yield r
    except Exception as e:
        log.msg('Unhandled exception from deferred when doing '
                'TestReactor.advance()', e)
        raise