From 6f8693a77f569107252fb0e7653bd125c69eff3d Mon Sep 17 00:00:00 2001 From: tooomm Date: Sun, 11 Jan 2026 10:07:36 +0100 Subject: [PATCH] Improve error messages for card parsing --- magic_spoiler/__main__.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/magic_spoiler/__main__.py b/magic_spoiler/__main__.py index c190e364..8ac60a9c 100644 --- a/magic_spoiler/__main__.py +++ b/magic_spoiler/__main__.py @@ -250,12 +250,13 @@ def scryfall2mtgjson(scryfall_cards: List[Dict[str, Any]]) -> List[Dict[str, Any "subTypes": sub_types, } trice_cards.append(trice_card) + except Exception as e: # If running in GitHub Actions CI, print the message as a warning if 'GITHUB_ACTION' in os.environ: - print(f"::warning::Unable to parse {sf_card.get('name')} ({sf_card.get('set')}): {str(e)}") + print(f'::warning::Unable to parse "{sf_card.get("name")}" ({sf_card.get("set").upper()}): {str(e)}') else: - print(f"Unable to parse {sf_card.get('name')} ({sf_card.get('set')}): {str(e)}") + print(f'Unable to parse "{sf_card.get("name")}" ({sf_card.get("set").upper()}): {str(e)}') return trice_cards