From 3b205aa6761136b78ad3a27257dfc62b0a1a2879 Mon Sep 17 00:00:00 2001 From: Sean Breckenridge Date: Sun, 2 Jun 2024 17:31:03 -0700 Subject: [PATCH] yield instead of returning errors --- my/smscalls.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/my/smscalls.py b/my/smscalls.py index 35e4d8c..7a8a2ed 100644 --- a/my/smscalls.py +++ b/my/smscalls.py @@ -240,9 +240,11 @@ def _extract_mms(path: Path) -> Iterator[Res[MMS]]: user_type = addr_data.get('type') if user_address is None or user_type is None: addr_str = etree.tostring(addr_parent).decode() - return RuntimeError(f'Missing one or more required attributes [address, type] in {addr_str}') + yield RuntimeError(f'Missing one or more required attributes [address, type] in {addr_str}') + continue if not user_type.isdigit(): - return RuntimeError(f'Invalid type {user_type}') + yield RuntimeError(f'Invalid string {user_type} {type(user_type)}, cannot convert to number') + continue addresses.append((user_address, int(user_type))) content: List[MMSContentPart] = []