Commit b9b4fbe0 authored by Michael Büsch's avatar Michael Büsch

Beautify exception text

Signed-off-by: Michael Büsch's avatarMichael Buesch <m@bues.ch>
parent a4f5e213
......@@ -109,8 +109,14 @@ class AwlSimError(Exception):
else:
sourceName = ""
ret = [ "%s:\n\n" % title ]
ret.append("ERROR at %sline %s:\n" %\
(sourceName, self.getLineNrStr()))
fileStr = ""
if sourceName:
fileStr = " in %s" % sourceName
lineStr = ""
if self.getLineNr() is not None:
lineStr = " at line %d" % self.getLineNr()
if fileStr or lineStr:
ret.append("Error%s%s:\n" % (fileStr, lineStr))
insnStr = self.getFailingInsnStr()
if insnStr:
ret.append(" %s\n" % insnStr)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment