diff options
-rw-r--r-- | server/handlers.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/server/handlers.py b/server/handlers.py index d1ad634..2e15a0e 100644 --- a/server/handlers.py +++ b/server/handlers.py @@ -252,8 +252,11 @@ class Hint(CodeqService): if lang_session is None: request.reply({'code': 3, 'message': 'No active session exists'}) else: - hints = lang_session.hint(session.get_sid(), problem_id, program) - request.reply({'code': 0, 'message': 'ok', 'hints': hints}) + try: + hints = lang_session.hint(session.get_sid(), problem_id, program) + request.reply({'code': 0, 'message': 'ok', 'hints': hints}) + except Exception as ex: + request.reply({'code': 4, 'message': str(ex)}) class Test(CodeqService): |