class_docstr: Retries if an exception message equals or matches.
class_docstr_tok: ["Retries","if","an","exception","message","equals","or","matches","."]
code: def __init__(self, message=None, match=None):
      if message and match:
          raise TypeError(
              "{}() takes either 'message' or 'match', not both".format(
                  self.__class__.__name__
              )
          )
  
      # set predicate
      if message:
  
          def message_fnc(exception):
              return message == str(exception)
  
          predicate = message_fnc
      elif match:
          prog = re.compile(match)
  
          def match_fnc(exception):
              return prog.match(str(exception))
  
          predicate = match_fnc
      else:
          raise TypeError(
              "{}() missing 1 required argument 'message' or 'match'".format(
                  self.__class__.__name__
              )
          )
  
      super(retry_if_exception_message, self).__init__(predicate)
  
imports: import abc
  import re
  import six
label_desc: Use image node_id 1 to create a new retry_if_exception_message object from inherited base classes: retry_if_exception with example: obj = retry_if_exception_message(message, match)