parameters: (obj, error_message, mapping={})
docstring: Generate an error for 'obj' with the corresponding 'error_message'.
      This method is usefull for Constraint authors, in case of an error, they
      can simply call::
  
        >>> if something_is_wrong:
        >>>   error_list.append(self._generateError(obj, 'Something is wrong !')
  
      Then this message ("Something is wrong !") will be translated when the
      caller of document.checkConsistency() calls getTranslatedMessage() on
      a ConsistencyMessage instance returned by checkConsistency.
  
      Possible messages should be defined in constraint definition, in the list
      _message_id_list, and a default message value should be defined as class
      attribute.
  
      In the example, you would have in the constraint class definition::
  
        # list of existing messages
        _message_id_list = ['message_something_wrong']
        # messages default value
        message_something_wrong = 'Something is wrong: ${what}'
  
      We'll use _getMessage to get the corresponding message.
      The implementation uses ERP5Type's Messages, so it's possible to use a
      'mapping' for substitution, like this::
  
        >>> if something_is_wrong:
        >>>   error_list.append(self._generateError(obj,
        ...      self._getMessage('message_something_wrong'),
        ...      mapping=dict(what=obj.getTheWrongThing())))
docstring_summary: Generate an error for 'obj' with the corresponding 'error_message'.
      This method is usefull for Constraint authors, in case of an error, they
      can simply call::
docstring_tokens: Generate an error for obj with the corresponding error_message . This method is usefull for Constraint authors in case of an error they can simply call ::
function: def _generateError(obj, error_message, mapping={}):
      """Generate an error for 'obj' with the corresponding 'error_message'.
      This method is usefull for Constraint authors, in case of an error, they
      can simply call::
  
        >>> if something_is_wrong:
        >>>   error_list.append(self._generateError(obj, 'Something is wrong !')
  
      Then this message ("Something is wrong !") will be translated when the
      caller of document.checkConsistency() calls getTranslatedMessage() on
      a ConsistencyMessage instance returned by checkConsistency.
  
      Possible messages should be defined in constraint definition, in the list
      _message_id_list, and a default message value should be defined as class
      attribute.
  
      In the example, you would have in the constraint class definition::
  
        # list of existing messages
        _message_id_list = ['message_something_wrong']
        # messages default value
        message_something_wrong = 'Something is wrong: ${what}'
  
      We'll use _getMessage to get the corresponding message.
      The implementation uses ERP5Type's Messages, so it's possible to use a
      'mapping' for substitution, like this::
  
        >>> if something_is_wrong:
        >>>   error_list.append(self._generateError(obj,
        ...      self._getMessage('message_something_wrong'),
        ...      mapping=dict(what=obj.getTheWrongThing())))
      """
function_tokens: def _generateError ( obj , error_message , mapping = { } ) :