code: def handle_error(self, error):
          
          # This error was HTTP-related
          if isinstance(error, HTTPError):
              err_code = error.code
              err_msg = error.msg
              err_info = ''
          else:
              err_code = 500
              err_msg = "Server Error"
              err_info = "%s" % error
              print("Unexpected Server Error", file=stderr)
              traceback.print_tb(error.__traceback__, file=stderr)
  
          # for error_handler in self.http_application.next_error_handler(req):
          err_str = (
              "<html>"
              "<head></head>"
              "<body><h1>HTTP Error : {code} {message}</h1><p>{info}</p></body>"
              "</html>\n"
          ).format(
              code=err_code,
              message=err_msg,
              info=err_info
          )
  
          header_info = {
              'code': err_code,
              'msg': err_msg,
              'date': HTTPResponse.get_current_time(),
              'length': len(err_str.encode()),
              'contents': err_str
          }
  
          response = '\r\n'.join((
              "HTTP/1.1 {code} {msg}",
              "Content-Type: text/html; charset=UTF-8",
              "Content-Length: {length}",
              "Date: {date}",
              "",
              "{contents}")).format(**header_info)
  
          self.transport.write(response.encode())
docs: An error handling function which will be called when an error is raised
          during a responder's on_data() function. There is no default
          functionality and the subclasses must overload this.
  
          Parameters
          ----------
          error : Exception
              Exception thrown during code execution