ruff: replace asserts outside of tests with Exceptions

This commit is contained in:
Jörg Thalheim
2025-08-20 15:45:49 +02:00
parent 5be9b8383b
commit dc5485d9f1
23 changed files with 257 additions and 91 deletions

View File

@@ -4,6 +4,7 @@ from collections.abc import Callable
from typing import Any, ClassVar, cast
import gi
from clan_lib.errors import ClanError
from clan_lib.machines.machines import Machine
from clan_vm_manager.clan_uri import ClanURI
@@ -109,7 +110,9 @@ class JoinList:
def _on_join_finished(self, source: JoinValue) -> None:
log.info(f"Join finished: {source.url}")
self.discard(source)
assert source.entry is not None
if source.entry is None:
msg = "Join entry is not available"
raise ClanError(msg)
ClanStore.use().push_history_entry(source.entry)
def discard(self, value: JoinValue) -> None: