/[AnywhereTS-MSSQL]/trunk/TSAdminTool/frmAdmin.cs
ViewVC logotype

Diff of /trunk/TSAdminTool/frmAdmin.cs

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

--- trunk/TSAdminTool/frmAdmin.cs	2012/07/11 14:19:13	4
+++ trunk/TSAdminTool/frmAdmin.cs	2012/07/12 14:17:14	46
@@ -8,7 +8,8 @@
     using System.Text;
     using System.Windows.Forms;
     using System.Runtime.InteropServices;
-    using System.IO; // For File operations
+    using System.IO;
+    using System.Data.SqlClient; // For File operations
     
 
     public partial class frmAdmin : Form
@@ -407,6 +408,10 @@
                 else
                 {   // Unhandled node
                     MessageBox.Show("Error: unhandled node (28843)");
+                    using (log4net.NDC.Push(string.Format("unhandled node={0}", node.Parent.Name)))
+                    {
+                        Logging.ATSAdminLog.Error("rror: unhandled node (28843)");
+                    }
                 }
             }
             else
@@ -755,6 +760,10 @@
             {
                 this.Cursor = Cursors.Default;
                 MessageBox.Show("Could not create directory '" + dataDir + "'. Error: " + ex.Message);
+                using (log4net.NDC.Push(string.Format("directory={0}", dataDir)))
+                {
+                    Logging.ATSAdminLog.Error("Could not create directory.");
+                }
                 return false;
             }
 
@@ -869,9 +878,13 @@
                 {
                     ProSupport.clientTableAdapter.FillClients(datasetAllClients.Client);
                 }
-                catch (Exception ex)
+                catch (SqlException ex)
                 {
                     MessageBox.Show("Unhandled SQL error, please restart AnywhereTS. Details: " + ex.Message);
+                    using (log4net.NDC.Push(string.Format("SqlException: ID={0} MESSAGE={1}{2}Diagnostics:{2}{3}", ex.Number.ToString(), ex.Message, System.Environment.NewLine, ex.ToString())))
+                    {
+                        Logging.ATSAdminLog.Error("Encountered Unhandled or Unexcepected SQL error");
+                    }
                     Application.Exit();
                     return;
                 }
@@ -911,6 +924,10 @@
             else
             {
                 MessageBox.Show("Error, no mode selected (56541)");
+                using (log4net.NDC.Push(string.Format("ATSGlobals.managedMode={0}", ATSGlobals.managedMode)))
+                {
+                    Logging.ATSAdminLog.Error("Error, no mode selected (56541)");
+                }
             }
         }
 

 

  ViewVC Help
Powered by ViewVC 1.1.22