Commit 3da1e2e7 authored by Arnaud Fontaine's avatar Arnaud Fontaine

Improve syntax error message.

parent 53908b6d
......@@ -68,12 +68,18 @@ class Component(Base):
message="No source code",
mapping={})]
message = None
try:
self.load()
except SyntaxError, e:
message = "%s (line: %d, column: %d)" % (e.msg, e.lineno, e.offset)
except Exception, e:
message = str(e)
if message:
return [ConsistencyMessage(self,
object_relative_url=self.getRelativeUrl(),
message="Source code error: %s" % e,
message="Source Code: %s" % message,
mapping={})]
return []
......
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