fix: sane error reporting

This commit is contained in:
Eray Özkural
2005-11-17 00:07:05 +00:00
parent 6ccb51a189
commit c11ec2e711
+3
View File
@@ -30,6 +30,7 @@ __trans = gettext.translation('pisi', fallback=True)
_ = __trans.ugettext
import codecs
import exceptions
import Ft
from Ft.Xml.Domlette import implementation
@@ -70,6 +71,8 @@ class XmlFile(object):
return self.doc.documentElement
except Ft.FtException, e:
raise Error(_("File '%s' has invalid XML: %s") % (path, str(e)) )
except exceptions.ValueError, e:
raise Error(_("File '%s' not found") % path )
def writexml(self, path):
f = file(path, 'w')