@secure_function
def set_error(scope, error_re=None):
    """
    Defines a pattern that, whenever detected in the response of the remote
    host, causes an error to be raised.