code: async def handle_server_error(self, req, res, mw_generator, error, err_count=0):
          
          if err_count >= self.error_recursion_max_depth:
              raise Exception("Too many exceptions:" + error)
  
          for mw in mw_generator:
              try:
                  if inspect.iscoroutinefunction(mw):
                      await mw(req, res, error)
                  else:
                      mw(req, res, error)
              except Exception as new_error:
                  await self.handle_server_error(
                      req,
                      res,
                      mw_generator,
                      new_error,
                      err_count + 1,
                  )
              finally:
                  if res.has_ended:
                      break
          else:
              self.default_error_handler(req, res, error)
              if not res.has_ended:  # noqa pragma: no cover
                  print("Default error handler did not send a response to "
                        "client!", file=sys.stderr)
docs: Entry point for handling an exception that occured during
          execution of the middleware chain.
          This loops through the middleware generator - which should
          produce error-handling functions of signature `(req, res, error)`.
          If an error occurs during this method,
  
          There is currently no way to do error recovery of the middleware
          chain.
  
          Args:
              req (growler.HTTPRequest): The incoming request, containing
                  all information about the client.
  
              res (growler.HTTPResponse): The outgoing response, containing
                  methods for sending headers and data back to the client.
  
              mw_generator (Generator): The generator producing middleware.
                  This has already been 'notified' of the error and should
                  now only yield error handling middleware.
  
              error (Exception): The exception raised during middleware
                  processing.
  
              err_count (int): A value for keeping track of recursive calls
                  to the error handler.
                  If this value equals self.error_recursion_max_depth, a
                  new exception is raised, potentially confusing everyone
                  involved.