'Regular callback function for undefined objects that raises an
`jinja2.exceptions.UndefinedError` on call.'

@internalcode
def _fail_with_undefined_error(self, *args, **kwargs):

    if (self._undefined_hint is None):
        if (self._undefined_obj is missing):
            hint = ('%r    is    undefined' % self._undefined_name)
        elif (not isinstance(self._undefined_name, string_types)):
            hint = ('%s    has    no    element    %r' % (object_type_repr(self._undefined_obj), self._undefined_name))
        else:
            hint = ('%r    has    no    attribute    %r' % (object_type_repr(self._undefined_obj), self._undefined_name))
    else:
        hint = self._undefined_hint
    raise self._undefined_exception(hint)
