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

Diff of /trunk/TSAdminTool/Program.cs

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

--- trunk/TSAdminTool/Program.cs	2012/07/12 19:23:51	66
+++ trunk/TSAdminTool/Program.cs	2012/07/12 19:34:37	67
@@ -40,11 +40,12 @@
             if (e.GetType() == typeof(SqlException))
             {
                 SqlException sql_ex = (e as SqlException);
+                Stack stack = new Stack();
                 using (log4net.NDC.Push(string.Format("SqlException: ID={0} MESSAGE={1}{2}Diagnostics:{2}{3}", sql_ex.Number.ToString(), sql_ex.Message, System.Environment.NewLine, sql_ex.ToString())))
                 {
+                    stack = log4net.NDC.CloneStack();
                     Logging.ATSAdminLog.Error("Encountered unhandled SqlException");
                 }
-                Stack stack = log4net.NDC.CloneStack();
                 List<object> strs = new List<object>(stack.ToArray());
                 strs.Reverse();
                 StringBuilder builder = new StringBuilder();
@@ -54,11 +55,12 @@
             }
             else
             {
+                Stack stack = new Stack();
                 using (log4net.NDC.Push(string.Format("Exception: MESSAGE={0}{1}Diagnostics:{1}{2}", e.Message, System.Environment.NewLine, e.ToString())))
                 {
+                    stack = log4net.NDC.CloneStack();
                     Logging.ATSAdminLog.Error("Encountered unhandled Exception");
-                }
-                Stack stack = log4net.NDC.CloneStack();
+                }                
                 List<object> strs = new List<object>(stack.ToArray());
                 strs.Reverse();
                 StringBuilder builder = new StringBuilder();

 

  ViewVC Help
Powered by ViewVC 1.1.22