Gestion d'erreur pour gamelist.xml dans update_gamelist.py
This commit is contained in:
@@ -73,6 +73,15 @@ def update_gamelist():
|
|||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.error(f"Erreur lors de la mise à jour de {GAMELIST_FILE}: {e}")
|
logger.error(f"Erreur lors de la mise à jour de {GAMELIST_FILE}: {e}")
|
||||||
raise
|
raise
|
||||||
|
|
||||||
|
def load_gamelist(path):
|
||||||
|
"""Charge le fichier gamelist.xml."""
|
||||||
|
try:
|
||||||
|
tree = ET.parse(path)
|
||||||
|
return tree.getroot()
|
||||||
|
except (FileNotFoundError, ET.ParseError) as e:
|
||||||
|
logging.error(f"Erreur lors de la lecture de {path} : {e}")
|
||||||
|
return None
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
update_gamelist()
|
update_gamelist()
|
||||||
Reference in New Issue
Block a user