diff --git a/frontends/src/jp/cmd_debug.py b/frontends/src/jp/cmd_debug.py index db864f98..23cf0f67 100644 --- a/frontends/src/jp/cmd_debug.py +++ b/frontends/src/jp/cmd_debug.py @@ -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')