summaryrefslogtreecommitdiff
path: root/yaksh/models.py
diff options
context:
space:
mode:
authoradityacp2017-03-17 13:57:21 +0530
committeradityacp2017-03-17 13:57:21 +0530
commit6c53c90ee5dd7184889fd3f99130b194e75fef4c (patch)
tree1cb0f16b1e8a6386c93204c6a0212033c74b8a12 /yaksh/models.py
parent8547c5bfe7be64256b412f484ab6a9f60628ef06 (diff)
downloadonline_test-6c53c90ee5dd7184889fd3f99130b194e75fef4c.tar.gz
online_test-6c53c90ee5dd7184889fd3f99130b194e75fef4c.tar.bz2
online_test-6c53c90ee5dd7184889fd3f99130b194e75fef4c.zip
Change Exception message for load questions
Diffstat (limited to 'yaksh/models.py')
-rw-r--r--yaksh/models.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/yaksh/models.py b/yaksh/models.py
index 80e215e..970f136 100644
--- a/yaksh/models.py
+++ b/yaksh/models.py
@@ -316,10 +316,8 @@ class Question(models.Model):
files_list=None):
try:
questions = json.loads(questions_list)
- except json.decoder.JSONDecodeError:
- exc_type, exc_value, exc_tb = sys.exc_info()
- tb_list = traceback.format_exception(exc_type, exc_value, exc_tb)
- msg = "Error Parsing Json: {0}".format(tb_list[-1])
+ except ValueError as exc_msg:
+ msg = "Error Parsing Json: {0}".format(exc_msg)
return msg
for question in questions:
question['user'] = user