summaryrefslogtreecommitdiffstats
path: root/reflect.py
diff options
context:
space:
mode:
authorjwansek <eddie.atten.ea29@gmail.com>2022-03-04 17:38:01 +0000
committerjwansek <eddie.atten.ea29@gmail.com>2022-03-04 17:38:01 +0000
commit524fa81d71d335a04ab3610c39c5c8e74eb732a4 (patch)
tree699260f2fece94510f4d61c366091d1b5f91ba2a /reflect.py
parent92f710554dac6fb75e0c3b4bcf4a0305ee4df4c3 (diff)
downloadSmarker-524fa81d71d335a04ab3610c39c5c8e74eb732a4.tar.gz
Smarker-524fa81d71d335a04ab3610c39c5c8e74eb732a4.zip
started work on templating for tex
Diffstat (limited to 'reflect.py')
-rw-r--r--reflect.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/reflect.py b/reflect.py
index c60c39e..dbe551f 100644
--- a/reflect.py
+++ b/reflect.py
@@ -260,8 +260,9 @@ def gen_reflection_report(client_code_path, assessment_struct, student_no, confi
out["files"][i][required_file]["exception"] = {}
out["files"][i][required_file]["exception"]["type"] = str(type(e))
out["files"][i][required_file]["exception"]["str"] = str(e)
- # TODO: work out how to only get the exception stack of the client code
- out["files"][i][required_file]["exception"]["traceback"] = ''.join(traceback.format_exception(None, e, e.__traceback__))
+ # TODO: test this indexing so we can be sure we're getting client code only
+ e_list = traceback.format_exception(None, e, e.__traceback__)
+ out["files"][i][required_file]["exception"]["traceback"] = ''.join([e_list[0]] + e_list[12:])
continue