def required_validator(ns, value):
    """
    Required value wizard validator. Raises ValueError on validation error.

    :param pypsi.namespace.Namespace ns: active namespace
    :param value: input value
    :returns: validated value
    """
    if value is None:
        raise ValueError('Value is required')
    if not isinstance(value, str):
        return value
    value = value.strip()
    if not value:
        raise ValueError('Value is required')
    return value
