code: def erred():
          
          exc_type, exc, tb = sys.exc_info()
          if issubclass(exc_type, socket.timeout):
              raise TimedOut
          elif issubclass(exc_type, requests.ConnectionError):
              internal_exc = exc.args[0]
              if isinstance(internal_exc, ReadTimeoutError):
                  raise TimedOut
              else:
                  raise ConnectionError(exc)
          elif issubclass(exc_type, requests.RequestException):
              raise EtcException(exc)
          reraise(exc_type, exc, tb)
docs: Wraps errors.  Call it in `except` clause::
  
             try:
                 do_something()
             except:
                 self.erred()