Do not print exception message below stacktrace
This commit is contained in:
@@ -221,7 +221,7 @@ class InputTypeBase(object):
|
||||
self.status = state.get('status', 'unanswered')
|
||||
|
||||
try:
|
||||
# Pre-parse and propcess all the declared requirements.
|
||||
# Pre-parse and process all the declared requirements.
|
||||
self.process_requirements()
|
||||
|
||||
# Call subclass "constructor" -- means they don't have to worry about calling
|
||||
|
||||
@@ -249,7 +249,11 @@ class CapaMixin(CapaFields):
|
||||
# e.g. in the CMS
|
||||
msg = u'<p>{msg}</p>'.format(msg=cgi.escape(msg))
|
||||
msg += u'<p><pre>{tb}</pre></p>'.format(
|
||||
tb=cgi.escape(traceback.format_exc()))
|
||||
# just the traceback, no message - it is already present above
|
||||
tb=cgi.escape(
|
||||
u''.join(['Traceback (most recent call last):\n'] +
|
||||
traceback.format_tb(sys.exc_info()[2])))
|
||||
)
|
||||
# create a dummy problem with error message instead of failing
|
||||
problem_text = (u'<problem><text><span class="inline-error">'
|
||||
u'Problem {url} has an error:</span>{msg}</text></problem>'.format(
|
||||
|
||||
Reference in New Issue
Block a user