From: Michal MalĂ˝ Date: Sun, 21 Dec 2014 02:34:12 +0000 (+0100) Subject: Log exceptions in Display_Assignment and Display_Checked_Answer X-Git-Url: https://gitweb.devoid-pointer.net/?a=commitdiff_plain;h=4cba95a0c4dab301e8deba414288dd3a5d8c7714;p=Nine-Q.git Log exceptions in Display_Assignment and Display_Checked_Answer --- diff --git a/src/problem_manager.adb b/src/problem_manager.adb index 13c0968..0fb92e0 100644 --- a/src/problem_manager.adb +++ b/src/problem_manager.adb @@ -3,6 +3,7 @@ with Ada.Strings.Fixed; with Ada.Text_IO; with Ada.Unchecked_Deallocation; with Face_Generator; +with Logging_System; package body Problem_Manager is @@ -31,11 +32,13 @@ package body Problem_Manager is Ret := Stored.Problem.Get_Assignment(Assignment, Build_Resource_Prefix(UID, Pr_Cat, Pr_ID)); if Ret /= OK then Stored.Mutex.Unlock; + Logging_System.Log(ERRMSG_GET_ASSIGNMENT & " (" & RetCode'Image(Ret) & ")", Logging_System.ERROR); return Face_Generator.Generate_Error_Face(HTML, ERRMSG_GET_ASSIGNMENT & " (" & RetCode'Image(Ret) & ")"); end if; 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; @@ -71,11 +74,13 @@ package body Problem_Manager is Ret := Stored.Problem.Get_Assignment(Assignment, Build_Resource_Prefix(UID, Pr_Cat, Pr_ID)); if Ret /= OK then Stored.Mutex.Unlock; + Logging_System.Log(ERRMSG_GET_ASSIGNMENT & " (" & RetCode'Image(Ret) & ")", Logging_System.ERROR); return Face_Generator.Generate_Error_Face(HTML, ERRMSG_GET_ASSIGNMENT & " (" & RetCode'Image(Ret) & ")"); end if; 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;