Add more info to parsing error message (#317)
Some checks failed
Deploy / Check for new spoiler (push) Has been cancelled

* Add exception to message

* Add set code

* Print warning in CI summary

* Improve error messages for card parsing
This commit is contained in:
tooomm 2026-01-28 22:36:33 +01:00 committed by GitHub
parent 4cef743e46
commit f8cdbc9a7f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -250,8 +250,13 @@ def scryfall2mtgjson(scryfall_cards: List[Dict[str, Any]]) -> List[Dict[str, Any
"subTypes": sub_types, "subTypes": sub_types,
} }
trice_cards.append(trice_card) 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 return trice_cards