From 8440a885a622c3ec7782278a7e9f8c1a60dc3690 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Michal=20Mal=C3=BD?= Date: Tue, 23 Dec 2014 19:40:37 +0100 Subject: [PATCH] Catch unhandled exceptions that might occur in Check_Answer --- src/problem_manager.adb | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/problem_manager.adb b/src/problem_manager.adb index 0fb92e0..213bc53 100644 --- a/src/problem_manager.adb +++ b/src/problem_manager.adb @@ -42,7 +42,14 @@ package body Problem_Manager is return Face_Generator.Generate_Error_Face(HTML, ERRMSG_UNHANDLED_EXCEPTION & " (" & Ada.Exceptions.Exception_Information(Ex) & ")"); end; - ARC := Stored.Problem.Check_Answer(Answer, Answer_Message); + begin + ARC := Stored.Problem.Check_Answer(Answer, Answer_Message); + exception + when Ex: others => + Stored.Mutex.Unlock; + Logging_System.Log(ERRMSG_UNHANDLED_EXCEPTION & " (" & Ada.Exceptions.Exception_Information(Ex) & ")", Logging_System.ERROR); + return Face_Generator.Generate_Error_Face(HTML, ERRMSG_UNHANDLED_EXCEPTION & " (" & Ada.Exceptions.Exception_Information(Ex) & ")"); + end; Stored.Mutex.Unlock; return Face_Generator.Generate_Face_With_Answer(Assignment => Assignment, Answer_Message => Answer_Message, Answer_Code => ARC, HTML => HTML, -- 2.43.5