From f8cdbc9a7ff72f69cb39e0a596ac860d657720d5 Mon Sep 17 00:00:00 2001 From: tooomm Date: Wed, 28 Jan 2026 22:36:33 +0100 Subject: [PATCH] Add more info to parsing error message (#317) * Add exception to message * Add set code * Print warning in CI summary * Improve error messages for card parsing --- magic_spoiler/__main__.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/magic_spoiler/__main__.py b/magic_spoiler/__main__.py index 3d5c5947..8ac60a9c 100644 --- a/magic_spoiler/__main__.py +++ b/magic_spoiler/__main__.py @@ -250,8 +250,13 @@ def scryfall2mtgjson(scryfall_cards: List[Dict[str, Any]]) -> List[Dict[str, Any "subTypes": sub_types, } trice_cards.append(trice_card) - except Exception: - print(f"Unable to parse {sf_card.get('name')}") + + 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").upper()}): {str(e)}') + else: + print(f'Unable to parse "{sf_card.get("name")}" ({sf_card.get("set").upper()}): {str(e)}') return trice_cards