Catch ValueErrors from removing callbacks that were already removed

This can happen from asynchronous access.

Fixes Sentry issue CURA-3YV.
This commit is contained in:
Ghostkeeper 2022-06-07 13:55:48 +02:00
parent efeb29c734
commit fb3f065fe0
No known key found for this signature in database
GPG Key ID: D2A8871EE34EC59A

View File

@ -169,7 +169,10 @@ class ClusterApiClient:
"""
def parse() -> None:
self._anti_gc_callbacks.remove(parse)
try:
self._anti_gc_callbacks.remove(parse)
except ValueError: # Already removed asynchronously.
return # Then the rest of the function is also already executed.
# Don't try to parse the reply if we didn't get one
if reply.attribute(QNetworkRequest.Attribute.HttpStatusCodeAttribute) is None: