r"""
        Raise exception conditionally.

        :param exname: Exception name
        :type  exname: string

        :param condition: Flag that indicates whether the exception is
                          raised *(True)* or not *(False)*
        :type  condition: boolean

        :param edata: Replacement values for fields in the exception message
                      (see :py:meth:`pexdoc.ExHandle.add_exception` for how
                      to define fields). Each dictionary entry can only have
                      these two keys:

                      * **field** *(string)* -- Field name

                      * **value** *(any)* -- Field value, to be converted into
                        a string with the `format
                        <https://docs.python.org/2/library/stdtypes.html#
                        str.format>`_ string method

                      If None no field replacement is done
        :type  edata: dictionary, iterable of dictionaries or None

        :raises:
         * RuntimeError (Argument \\`condition\\` is not valid)

         * RuntimeError (Argument \\`edata\\` is not valid)

         * RuntimeError (Argument \\`exname\\` is not valid)

         * RuntimeError (Field *[field_name]* not in exception message)

         * ValueError (Exception name *[name]* not found')

def raise_exception_if(self, exname, condition, edata=None, _keys=None):
        r"""
        Raise exception conditionally.

        :param exname: Exception name
        :type  exname: string

        :param condition: Flag that indicates whether the exception is
                          raised *(True)* or not *(False)*
        :type  condition: boolean

        :param edata: Replacement values for fields in the exception message
                      (see :py:meth:`pexdoc.ExHandle.add_exception` for how
                      to define fields). Each dictionary entry can only have
                      these two keys:

                      * **field** *(string)* -- Field name

                      * **value** *(any)* -- Field value, to be converted into
                        a string with the `format
                        <https://docs.python.org/2/library/stdtypes.html#
                        str.format>`_ string method

                      If None no field replacement is done
        :type  edata: dictionary, iterable of dictionaries or None

        :raises:
         * RuntimeError (Argument \\`condition\\` is not valid)

         * RuntimeError (Argument \\`edata\\` is not valid)

         * RuntimeError (Argument \\`exname\\` is not valid)

         * RuntimeError (Field *[field_name]* not in exception message)

         * ValueError (Exception name *[name]* not found')

        """
        # _edict is an argument used by the _ExObj class which saves a
        # second exception look-up since the _ExObj class can save the
        # call dictionary
        if not isinstance(condition, bool):
            raise RuntimeError("Argument `condition` is not valid")
        if not self._validate_edata(edata):
            raise RuntimeError("Argument `edata` is not valid")
        if _keys is None:
            if not isinstance(exname, str):
                raise RuntimeError("Argument `exname` is not valid")
            # Find exception object
            func_id, func_name = self._get_ex_data()
            name = "{0}{1}{2}".format(func_id, self._callables_separator, exname)
            for key, value in self._ex_dict[func_id].items():
                if value["name"] == name:
                    break
            else:
                raise ValueError(
                    "Exception name {exname} not found".format(exname=exname)
                )
            _keys = (func_id, key, func_name)
        eobj = self._ex_dict[_keys[0]][_keys[1]]
        if condition:
            eobj["raised"][eobj["function"].index(_keys[2])] = True
            self._raise_exception({"type": _keys[1][0], "msg": _keys[1][1]}, edata)