]> Devoid-pointer.net GitWeb - Nine-Q.git/commitdiff
Log exceptions in Display_Assignment and Display_Checked_Answer
authorMichal Malý <madcatxster@devoid-pointer.net>
Sun, 21 Dec 2014 02:34:12 +0000 (03:34 +0100)
committerMichal Malý <madcatxster@devoid-pointer.net>
Sun, 21 Dec 2014 02:34:12 +0000 (03:34 +0100)
src/problem_manager.adb

index 13c09688d30369ecbab3efe5a83666d2dd0685aa..0fb92e0d4716f26907cb1a110e4f382780783d1a 100644 (file)
@@ -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;