[IMP] display more informations about XML parse errors (file and line number of troubled element)
bzr revid: xmo@openerp.com-20101012094250-n43amm773c43o9e6
This commit is contained in:
parent
42c2a2eb3d
commit
aa7772940c
|
@ -216,6 +216,7 @@ class assertion_report(object):
|
|||
return res
|
||||
|
||||
class xml_import(object):
|
||||
__logger = logging.getLogger('tools.convert.xml_import')
|
||||
@staticmethod
|
||||
def nodeattr2bool(node, attr, default=False):
|
||||
if not node.get(attr):
|
||||
|
@ -847,7 +848,10 @@ form: module.record_id""" % (xml_id,)
|
|||
try:
|
||||
self._tags[rec.tag](self.cr, rec, n)
|
||||
except:
|
||||
self.logger.notifyChannel("init", netsvc.LOG_ERROR, '\n'+etree.tostring(rec))
|
||||
self.__logger.error('Parse error in %s:%d: \n%s',
|
||||
rec.getroottree().docinfo.URL,
|
||||
rec.sourceline,
|
||||
etree.tostring(rec).strip())
|
||||
self.cr.rollback()
|
||||
raise
|
||||
return True
|
||||
|
|
Loading…
Reference in New Issue