class_docstr: Base class for a backend manager class 
class_docstr_tok: ["Base","class","for","a","backend","manager","class"]
docstr: Convenience send() method providing a standardized error reporting 
docstr_tok: ["Convenience","send","(",")","method","providing","a","standardized","error","reporting"]
code: def _send(
      cls,
      session,
      req,
      ignore_errors=False,
      raise_on_errors=True,
      log=None,
      async_enable=False,
  ):
      """Convenience send() method providing a standardized error reporting"""
      if cls._offline_mode:
          return None
  
      num_retries = 0
      while True:
          error_msg = ""
          try:
              res = session.send(req, async_enable=async_enable)
              if res.meta.result_code in (200, 202) or ignore_errors:
                  return res
  
              if isinstance(req, BatchRequest):
                  error_msg = "Action failed %s" % res.meta
              else:
                  error_msg = "Action failed %s (%s)" % (
                      res.meta,
                      ", ".join(
                          "%s=%s" % p for p in req.to_dict().items()
                      ),
                  )
              if log:
                  log.error(error_msg)
  
          except requests.exceptions.BaseHTTPError as e:
              res = None
              if log and num_retries >= cls._num_retry_warning_display:
                  log.warning(
                      "Retrying, previous request failed %s: %s"
                      % (str(type(req)), str(e))
                  )
          except MaxRequestSizeError as e:
              res = CallResult(
                  meta=ResponseMeta.from_raw_data(
                      status_code=400, text=str(e)
                  )
              )
              error_msg = "Failed sending: %s" % str(e)
          except requests.exceptions.ConnectionError as e:
              # We couldn't send the request for more than the retries times configure in the api configuration file,
              # so we will end the loop and raise the exception to the upper level.
              # Notice: this is a connectivity error and not a backend error.
              # if raise_on_errors:
              #     raise
              res = None
              if log and num_retries >= cls._num_retry_warning_display:
                  log.warning(
                      "Retrying, previous request failed %s: %s"
                      % (str(type(req)), str(e))
                  )
          except cls._JSON_EXCEPTION as e:
              if log:
                  log.error(
                      "Field %s contains illegal schema: %s",
                      ".".join(e.path),
                      str(e.message),
                  )
              if raise_on_errors:
                  raise ValidationError(
                      "Field %s contains illegal schema: %s"
                      % (".".join(e.path), e.message)
                  )
              # We do not want to retry
              return None
          except Exception as e:
              res = None
              if log and num_retries >= cls._num_retry_warning_display:
                  log.warning(
                      "Retrying, previous request failed %s: %s"
                      % (str(type(req)), str(e))
                  )
  
          if res and res.meta.result_code <= 500:
              # Proper backend error/bad status code - raise or return
              if raise_on_errors:
                  raise SendError(res, error_msg)
              return res
  
          num_retries += 1
  
imports: import abc
  import requests.exceptions
  import six
  import jsonschema
  from ..backend_api import Session, CallResult
  from ..backend_api.session.session import MaxRequestSizeError
  from ..backend_api.session.response import ResponseMeta
  from ..backend_api.session import BatchRequest
  from ..backend_api.session.defs import ENV_ACCESS_KEY, ENV_SECRET_KEY, ENV_OFFLINE_MODE
  from ..config import config_obj
  from ..config.defs import LOG_LEVEL_ENV_VAR
  from ..debugging import get_logger
  from .session import SendError, SessionInterface
label_desc: Use image node_id 5 for calling the InterfaceBase obj's underlying member method code with example usage: obj._send(cls, session, req, ignore_errors, raise_on_errors, log, async_enable) and returns: None, res, res, None