code: def get_error_details(self):
          # type: () -> Optional[Dict[str, Any]]
          
  
          details = {}  # type: Dict[str, Any]
  
          if ERROR.details:
              details = {"xerror_details": ERROR.details}
              ERROR.details = None
              xserver_error = ctypes.create_string_buffer(1024)
              self.xlib.XGetErrorText(
                  MSS.display,
                  details.get("xerror_details", {}).get("error_code", 0),
                  xserver_error,
                  len(xserver_error),
              )
              xerror = xserver_error.value.decode("utf-8")
              if xerror != "0":
                  details["xerror"] = xerror
  
          return details
docs: Get more information about the latest X server error.