mirror of
https://github.com/Cockatrice/Magic-Spoiler.git
synced 2026-03-21 17:54:59 -05:00
Improve error messages for card parsing
This commit is contained in:
parent
9815ca0bf6
commit
6f8693a77f
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user