def fail_archive_on_error(func):

    @functools.wraps(func)
    def wrapped(*args, **kwargs):
        try:
            return func(*args, **kwargs)
        except __HOLE__ as e:
            _inject_nodes(kwargs)
            registration = kwargs['node']
            registration.archive_status = ARCHIVER_NETWORK_ERROR
            registration.save()
            signals.archive_fail.send(
                registration,
                errors=[e.message]
            )
    return wrapped
dataset/ETHPy150Open CenterForOpenScience/osf.io/website/archiver/decorators.py/fail_archive_on_error