fix: handle HTTPError in JetBrainsPluginClient initialization

When the JetBrains plugin service returns HTTP 503 error, the client
now gracefully handles it by setting _plugin_version and _project_root
to None, allowing the port scanning logic to continue trying other ports.

Fixes #962
This commit is contained in:
Yinan Zhang committed 2026-01-21 11:35:10 +08:00
1 parent d73d9951fd
commit 3d61055127
1 file changed
+1 -1
+1 -1
View File
@@ -93,7 +93,7 @@ class JetBrainsPluginClient(ToStringMixin):
status_response: PluginStatusDTO = cast(jb.PluginStatusDTO, self._make_request("GET", "/status"))
self._project_root = status_response["project_root"]
self._plugin_version = Version(status_response["plugin_version"])
except ConnectionError:
except (ConnectionError, requests.exceptions.HTTPError):
self._project_root = None
self._plugin_version = None