-
Notifications
You must be signed in to change notification settings - Fork 10
Open
Description
Title: Refactor: Remove Redundant nested Try/Except Blocks for File Loading
Body:
The code uses nested try...except UnicodeDecodeError blocks when loading both the rulings file and individual card set files. This is redundant. While handling UnicodeDecodeError is a good practice, nesting these blocks makes the code harder to read and maintain. It also makes it difficult to distinguish between errors arising from the file open operation vs the json.load.
Recommendation:
Refactor the error handling. Remove the inner try block, and let any other exceptions propagate to the outer except Exception as e block. Make sure to log specifically what part of the loading is failing by printing either "rulings_data" or "data" or "cards.json"
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels