diff options
author | adityacp | 2017-03-17 13:57:21 +0530 |
---|---|---|
committer | adityacp | 2017-03-17 13:57:21 +0530 |
commit | 6c53c90ee5dd7184889fd3f99130b194e75fef4c (patch) | |
tree | 1cb0f16b1e8a6386c93204c6a0212033c74b8a12 | |
parent | 8547c5bfe7be64256b412f484ab6a9f60628ef06 (diff) | |
download | online_test-6c53c90ee5dd7184889fd3f99130b194e75fef4c.tar.gz online_test-6c53c90ee5dd7184889fd3f99130b194e75fef4c.tar.bz2 online_test-6c53c90ee5dd7184889fd3f99130b194e75fef4c.zip |
Change Exception message for load questions
-rw-r--r-- | yaksh/models.py | 6 |
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 |