def METHOD_NAME(self):
    dirent_name = self.cleaned_data['dirent_name']
    try:
        if not is_valid_dirent_name(dirent_name):
            error_msg = _('Name "%s" is not valid') % dirent_name
            raise forms.ValidationError(error_msg)
        else:
            return dirent_name
    except SearpcError as e:
        raise forms.ValidationError(str(e))