From 523ff4ea0fbb6dee06b245771e52c1bbc44c8178 Mon Sep 17 00:00:00 2001 From: Thomas Leonard Date: Thu, 7 Aug 2008 22:04:44 +0100 Subject: [PATCH] Log a useful warning if a user_overrides file gets corrupted. Don't know what could cause this, though. Reported on the ROX web-site. --- zeroinstall/injector/reader.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/zeroinstall/injector/reader.py b/zeroinstall/injector/reader.py index 3576296..2dfe983 100644 --- a/zeroinstall/injector/reader.py +++ b/zeroinstall/injector/reader.py @@ -6,7 +6,7 @@ Parses an XML interface into a Python representation. # See the README file for details, or visit http://0install.net. import os -from logging import debug, info +from logging import debug, info, warn from os.path import dirname from zeroinstall.support import basedir @@ -64,7 +64,11 @@ def update_user_overrides(interface, main_feed = None): if not user: return - root = qdom.parse(file(user)) + try: + root = qdom.parse(file(user)) + except Exception, ex: + warn("Error reading '%s': %s", user, ex) + raise # This is a bit wrong; this information is about the feed, # not the interface. -- 2.11.4.GIT