Log file and GUI improvment

This commit is contained in:
szporowolik
2019-10-21 16:41:10 +02:00
parent 1a73404c4c
commit 49495ba9c4
4 changed files with 48 additions and 25 deletions

View File

@@ -103,31 +103,31 @@ public class DatabaseController
Console.WriteLine(rdrMySQL[0] + " -- " + rdrMySQL[1]);
}
rdrMySQL.Close();
PerunHelper.GUILogHistoryAdd(ref Globals.arrGUILogHistory, "#" + strUDPFrameInstance + " > MySQL updated, package type: " + strUDPFrameType);
PerunHelper.GUILogHistoryAdd(ref Globals.arrGUILogHistory, "MySQL updated, package type: " + strUDPFrameType,1);
}
catch (ArgumentException a_ex)
{
// General exception found
Console.WriteLine(a_ex.ToString());
PerunHelper.GUILogHistoryAdd(ref Globals.arrGUILogHistory, "#" + strUDPFrameInstance + " > ERROR MySQL - package type: " + strUDPFrameType);
PerunHelper.GUILogHistoryAdd(ref Globals.arrGUILogHistory, "#" + strUDPFrameInstance + " > ERROR MySQL >" + a_ex.Message);
PerunHelper.GUILogHistoryAdd(ref Globals.arrGUILogHistory, "ERROR MySQL - package type: " + strUDPFrameType,1,1);
PerunHelper.GUILogHistoryAdd(ref Globals.arrGUILogHistory, "ERROR MySQL - error: " + a_ex.Message,1,1);
bStatus = false;
}
catch (MySqlException m_ex)
{
// MySQL exception found
PerunHelper.GUILogHistoryAdd(ref Globals.arrGUILogHistory, "#" + strUDPFrameInstance + " > ERROR MySQL - package type: " + strUDPFrameType);
PerunHelper.GUILogHistoryAdd(ref Globals.arrGUILogHistory, "ERROR MySQL - package type: " + strUDPFrameType,1,1);
switch (m_ex.Number)
{
case 1042: // Unable to connect to any of the specified MySQL hosts (Check Server,Port)
PerunHelper.GUILogHistoryAdd(ref Globals.arrGUILogHistory, "#" + strUDPFrameInstance + " > ERROR MySQL - unable to connect >" + m_ex.Message);
PerunHelper.GUILogHistoryAdd(ref Globals.arrGUILogHistory, "ERROR MySQL - unable to connect, error: " + m_ex.Message,1,1);
break;
case 0: // Access denied (Check DB name,username,password)
PerunHelper.GUILogHistoryAdd(ref Globals.arrGUILogHistory, "#" + strUDPFrameInstance + " > ERROR MySQL - access denied > " + m_ex.Message);
PerunHelper.GUILogHistoryAdd(ref Globals.arrGUILogHistory, "ERROR MySQL - access denied, error: " + m_ex.Message,1,1);
break;
default:
PerunHelper.GUILogHistoryAdd(ref Globals.arrGUILogHistory, "#" + strUDPFrameInstance + " > ERROR MySQL > " + m_ex.Number);
PerunHelper.GUILogHistoryAdd(ref Globals.arrGUILogHistory, "#" + strUDPFrameInstance + " > ERROR MySQL > " + m_ex.Message);
PerunHelper.GUILogHistoryAdd(ref Globals.arrGUILogHistory, "ERROR MySQL - error id: " + m_ex.Number,1,1);
PerunHelper.GUILogHistoryAdd(ref Globals.arrGUILogHistory, "ERROR MySQL - error: " + m_ex.Message,1,1);
break;
}
bStatus = false;
@@ -137,7 +137,7 @@ public class DatabaseController
}
catch (ArgumentException x_ex)
{
PerunHelper.GUILogHistoryAdd(ref Globals.arrGUILogHistory, "#" + strUDPFrameInstance + " > ERROR MySQL - unable to connect > " + x_ex.Message);
PerunHelper.GUILogHistoryAdd(ref Globals.arrGUILogHistory, "ERROR MySQL - unable to connect, error: " + x_ex.Message,1,1);
}