Error handling for Unsupported Auto-ticket Tor use. This feature is currently Wireguard only

This commit is contained in:
SimplifiedPrivacy 2026-05-23 13:49:20 -04:00
parent 5766d39260
commit 15bd37c278

View file

@ -1648,17 +1648,25 @@ class Worker(QObject):
return False
def _maybe_auto_use_ticket(self):
try:
which_ticket, error_msg = do_we_use_a_random_ticket(ticket_observer)
except Exception:
profile_connection_type = self.profile.connection.code
if profile_connection_type == "wireguard":
try:
which_ticket, error_msg = do_we_use_a_random_ticket(ticket_observer)
except Exception:
return None
if error_msg:
self._ticket_error_emitted = True
self.change_page.emit(f'Ticket use failed: {error_msg}', True)
return None
if which_ticket is None or which_ticket == 'error':
return None
return self._consume_ticket(which_ticket, None)
# it's not wireguard,
else:
error_msg = "Tickets are not yet supported for Tor. We are very sorry, but we're not able to develop all features for all products."
print(error_msg)
return None
if error_msg:
self._ticket_error_emitted = True
self.change_page.emit(f'Ticket use failed: {error_msg}', True)
return None
if which_ticket is None or which_ticket == 'error':
return None
return self._consume_ticket(which_ticket, None)
def _consume_ticket(self, which_ticket, which_location):
candidates = self._location_candidates(preferred=which_location)