jp (debug/monitor): if data can't be parsed (happen at beginning/end of stream because it's not complete XML), it is printed directly.
This commit is contained in:
parent
3042d42bc4
commit
a7781537d6
1 changed files with 10 additions and 1 deletions
|
|
@ -138,7 +138,16 @@ class Monitor(base.CommandBase):
|
|||
if whiteping:
|
||||
self.disp('[WHITESPACE PING]')
|
||||
else:
|
||||
self.output(xml_data)
|
||||
try:
|
||||
self.output(xml_data)
|
||||
except Exception:
|
||||
# initial stream is not valid XML,
|
||||
# in this case we print directly to data
|
||||
# FIXME: we should test directly lxml.etree.XMLSyntaxError
|
||||
# but importing lxml directly here is not clean
|
||||
# should be wrapped in a custom Exception
|
||||
self.disp(xml_data)
|
||||
self.disp(u'')
|
||||
|
||||
def start(self):
|
||||
self.host.bridge.register_signal('xmlLog', self.printXML, 'plugin')
|
||||
|
|
|
|||
Loading…
Reference in a new issue