Merge pull request #3798 from GNS3/bugfix/3794

Fix error reporting after PyQt6 migration
This commit is contained in:
Jeremy Grossmann
2026-03-21 10:38:05 +08:00
committed by GitHub
5 changed files with 6 additions and 7 deletions

View File

@@ -432,7 +432,7 @@ class Controller(QtCore.QObject):
else:
self._notification_stream = self._http_client.connectWebSocket(self._websocket, "/notifications/ws")
self._notification_stream.textMessageReceived.connect(self._websocket_event_received)
self._notification_stream.error.connect(self._websocket_error)
self._notification_stream.errorOccurred.connect(self._websocket_error)
self._notification_stream.sslErrors.connect(self._sslErrorsSlot)
log.info("Listening for controller notifications on '{}'".format(self._notification_stream.requestUrl().toString()))

View File

@@ -574,8 +574,7 @@ class HTTPClient(QtCore.QObject):
context["query_id"] = str(uuid.uuid4())
response.finished.connect(qpartial(self._processResponse, response, server, callback, context, body, ignoreErrors))
#FIXME:
#response.error.connect(qpartial(self._processError, response, server, callback, context, body, ignoreErrors))
response.errorOccurred.connect(qpartial(self._processError, response, server, callback, context, body, ignoreErrors))
if downloadProgressCallback is not None:
response.readyRead.connect(qpartial(self._readyReadySlot, response, downloadProgressCallback, context, server))
@@ -665,7 +664,7 @@ class HTTPClient(QtCore.QObject):
if "query_id" in context:
self._notify_progress_end_query(context["query_id"])
if error_code < 200 or error_code == 403:
if error_code.value < 200 or error_code.value == 403:
if error_code == QtNetwork.QNetworkReply.NetworkError.OperationCanceledError: # It's legit to cancel do not disconnect
error_message = "Operation timeout" # It's clearer than cancel because cancel is triggered by us when we timeout
elif error_code == QtNetwork.QNetworkReply.NetworkError.NetworkSessionFailedError:

View File

@@ -642,7 +642,7 @@ class Project(QtCore.QObject):
path = "/projects/{project_id}/notifications/ws".format(project_id=self._id)
self._notification_stream = Controller.instance().httpClient().connectWebSocket(self._websocket, path)
self._notification_stream.textMessageReceived.connect(self._websocket_event_received)
self._notification_stream.error.connect(self._websocket_error)
self._notification_stream.errorOccurred.connect(self._websocket_error)
self._notification_stream.sslErrors.connect(self._sslErrorsSlot)
log.info("Listening for project notifications on '{}'".format(self._notification_stream.requestUrl().toString()))

View File

@@ -1,3 +1,3 @@
-rrequirements.txt
PyQt6==6.10.1
PyQt6==6.10.2

View File

@@ -1,4 +1,4 @@
-rrequirements.txt
PyQt6==6.10.1 # pyup: ignore
PyQt6==6.10.2 # pyup: ignore
pywin32==311 # pyup: ignore