human
Solve the following python programming problem given the following code:
@utils.expects_func_args('migration')
def errors_out_migration(function):
assistant
#Here is the Python program you requested.

    """Decorator to error out migration on failure.
    """
    @functools.wraps(function)
    def decorated_function(self, context, *args, **kwargs):
        wrapped_func = safe_utils.get_wrapped_function(function)
        keyed_args = inspect.getcallargs(wrapped_func, self, context, *args, **kwargs)
        migration = keyed_args['migration']
        with errors_out_migration_ctxt(migration):
            return function(self, context, *args, **kwargs)
    return decorated_function