mirror of
https://github.com/GNS3/gns3-gui.git
synced 2026-05-17 00:46:01 +03:00
Fix errors from controller are not reported
This commit is contained in:
@@ -432,7 +432,7 @@ class Controller(QtCore.QObject):
|
|||||||
else:
|
else:
|
||||||
self._notification_stream = self._http_client.connectWebSocket(self._websocket, "/notifications/ws")
|
self._notification_stream = self._http_client.connectWebSocket(self._websocket, "/notifications/ws")
|
||||||
self._notification_stream.textMessageReceived.connect(self._websocket_event_received)
|
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)
|
self._notification_stream.sslErrors.connect(self._sslErrorsSlot)
|
||||||
log.info("Listening for controller notifications on '{}'".format(self._notification_stream.requestUrl().toString()))
|
log.info("Listening for controller notifications on '{}'".format(self._notification_stream.requestUrl().toString()))
|
||||||
|
|
||||||
|
|||||||
@@ -574,8 +574,7 @@ class HTTPClient(QtCore.QObject):
|
|||||||
context["query_id"] = str(uuid.uuid4())
|
context["query_id"] = str(uuid.uuid4())
|
||||||
|
|
||||||
response.finished.connect(qpartial(self._processResponse, response, server, callback, context, body, ignoreErrors))
|
response.finished.connect(qpartial(self._processResponse, response, server, callback, context, body, ignoreErrors))
|
||||||
#FIXME:
|
response.errorOccurred.connect(qpartial(self._processError, response, server, callback, context, body, ignoreErrors))
|
||||||
#response.error.connect(qpartial(self._processError, response, server, callback, context, body, ignoreErrors))
|
|
||||||
|
|
||||||
if downloadProgressCallback is not None:
|
if downloadProgressCallback is not None:
|
||||||
response.readyRead.connect(qpartial(self._readyReadySlot, response, downloadProgressCallback, context, server))
|
response.readyRead.connect(qpartial(self._readyReadySlot, response, downloadProgressCallback, context, server))
|
||||||
@@ -665,7 +664,7 @@ class HTTPClient(QtCore.QObject):
|
|||||||
if "query_id" in context:
|
if "query_id" in context:
|
||||||
self._notify_progress_end_query(context["query_id"])
|
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
|
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
|
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:
|
elif error_code == QtNetwork.QNetworkReply.NetworkError.NetworkSessionFailedError:
|
||||||
|
|||||||
@@ -642,7 +642,7 @@ class Project(QtCore.QObject):
|
|||||||
path = "/projects/{project_id}/notifications/ws".format(project_id=self._id)
|
path = "/projects/{project_id}/notifications/ws".format(project_id=self._id)
|
||||||
self._notification_stream = Controller.instance().httpClient().connectWebSocket(self._websocket, path)
|
self._notification_stream = Controller.instance().httpClient().connectWebSocket(self._websocket, path)
|
||||||
self._notification_stream.textMessageReceived.connect(self._websocket_event_received)
|
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)
|
self._notification_stream.sslErrors.connect(self._sslErrorsSlot)
|
||||||
log.info("Listening for project notifications on '{}'".format(self._notification_stream.requestUrl().toString()))
|
log.info("Listening for project notifications on '{}'".format(self._notification_stream.requestUrl().toString()))
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
-rrequirements.txt
|
-rrequirements.txt
|
||||||
|
|
||||||
PyQt6==6.10.1
|
PyQt6==6.10.2
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
-rrequirements.txt
|
-rrequirements.txt
|
||||||
|
|
||||||
PyQt6==6.10.1 # pyup: ignore
|
PyQt6==6.10.2 # pyup: ignore
|
||||||
pywin32==311 # pyup: ignore
|
pywin32==311 # pyup: ignore
|
||||||
|
|||||||
Reference in New Issue
Block a user