class_docstr: Retry strategy that retries if an exception verifies a predicate.
class_docstr_tok: ["Retry","strategy","that","retries","if","an","exception","verifies","a","predicate","."]
code: def __call__(self, retry_state: "RetryCallState") -> bool:
      if retry_state.outcome is None:
          raise RuntimeError("__call__() called before outcome was set")
  
      if retry_state.outcome.failed:
          exception = retry_state.outcome.exception()
          if exception is None:
              raise RuntimeError(
                  "outcome failed but the exception is None"
              )
          return self.predicate(exception)
      else:
          return False
  
imports: import abc
  import re
  import typing
label_desc: Use image node_id 2 for calling the retry_if_exception obj's underlying member method code with example usage: obj.__call__(retry_state) and returns: self, False