[FIX] RML reporting: understandable crash message

When tag <drawString> is misused in an RML report, logs a more explicit
error
This commit is contained in:
Richard Mathot 2014-07-02 17:29:13 +02:00
parent e80014eae3
commit fbbc3a54e9
1 changed files with 5 additions and 1 deletions

View File

@ -373,7 +373,11 @@ class _rml_canvas(object):
v = utils.attr_get(node, ['x','y'])
text=self._textual(node, **v)
text = utils.xml2str(text)
self.canvas.drawString(text=text, **v)
try:
self.canvas.drawString(text=text, **v)
except TypeError as e:
_logger.error("Bad RML: <drawReport> tag requires attributes 'x' and 'y'!")
raise e
def _drawCenteredString(self, node):
v = utils.attr_get(node, ['x','y'])