Le 21/06/10 11:23, Elver Loho a écrit :
On 17 June 2010 18:41, Cédric Krier<[email protected]> wrote:
On 17/06/10 07:47 -0700, Elver Loho wrote:
1. When I mess up XML somewhere, does Tryton also give me obscure
errors from the bowels of the core or does it do XML validation
beforehand for that not to happen? (I love the sweet way Genshi
handles my XML problems.)
We used lxml relax validation[1] and raise its error message which is not
always clear. I think it will be good to try to improve lxml on this topic.
Yeah, this is not very descriptive:
Traceback (most recent call last):
File "trytond/protocols/netrpc.py", line 47, in run
res = dispatch(host, port, 'NetRPC', *msg)
File "trytond/protocols/dispatcher.py", line 127, in dispatch
res = getattr(obj, method)(cursor, user, *args, **kargs)
File "trytond/wizard/wizard.py", line 147, in execute
action_res = getattr(self, action)(cursor, user, data, context)
File "trytond/ir/module/module.py", line 539, in _upgrade_module
pool.init(update=True, lang=lang)
File "trytond/pool.py", line 127, in init
lang=lang)
File "trytond/modules/__init__.py", line 435, in load_modules
load_module_graph(cursor, graph, pool, lang)
File "trytond/modules/__init__.py", line 255, in load_module_graph
tools.file_open(OPJ(module, filename)))
File "trytond/tools/convert.py", line 435, in parse_xmlstream
self.sax_parser.parse(source)
File "/_xmlplus/sax/expatreader.py", line 109, in parse
xmlreader.IncrementalParser.parse(self, source)
File "/_xmlplus/sax/xmlreader.py", line 123, in parse
self.feed(buffer)
File "/_xmlplus/sax/expatreader.py", line 220, in feed
self._err_handler.fatalError(exc)
File "/_xmlplus/sax/handler.py", line 38, in fatalError
raise exception
SAXParseException:<unknown>:9:0: junk after document element
Normally, the last line of log (just before the traceback) should give
you the id of the record on which the error happens, and the previous
line of log gives the file that is currently imported.
This is not perfect but it helps.
--
Bertrand Chenal
B2CK SPRL
Rue de Rotterdam, 4
4000 Liège
Belgium
Tel: +32 474 207 906
Email: [email protected]
Website: http://www.b2ck.com/
--
[email protected] mailing list