Check for on_failure or on_failure_retry for TermExceptions.