ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/AnywhereTS-MSSQL/trunk/AnywhereTS.DBSupport/DBConnector.cs
(Generate patch)

Comparing trunk/AnywhereTS.DBSupport/DBConnector.cs (file contents):
Revision 127 by william, Sat Jul 14 11:44:52 2012 UTC vs.
Revision 128 by william, Sat Jul 14 13:01:52 2012 UTC

# Line 79 | Line 79 | namespace AnywhereTS.DBSupport
79              }
80              catch (SqlException ex)
81              {
82 <                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())))
82 >                SqlException e = (ex.GetBaseException() as SqlException);
83 >                using (log4net.NDC.Push(string.Format("SqlException: ID={0} MESSAGE={1}{2}Diagnostics:{2}{3}", e.Number.ToString(), e.Message, System.Environment.NewLine, e.ToString())))
84                  {
85                      Logging.DatabaseLog.Error(string.Format("Failed to create command instance using command: {0}", command));
86                  }
# Line 87 | Line 88 | namespace AnywhereTS.DBSupport
88              }
89              catch (Exception ex)
90              {
91 <                using (log4net.NDC.Push(string.Format("{0}: MESSAGE={1}{2}Diagnostics:{2}{3}", ex.GetType().Name, ex.Message, System.Environment.NewLine, ex.ToString())))
91 >                Exception e = ex.GetBaseException();
92 >                using (log4net.NDC.Push(string.Format("{0}: MESSAGE={1}{2}Diagnostics:{2}{3}", e.GetType().Name, e.Message, System.Environment.NewLine, e.ToString())))
93                  {
94                      Logging.DatabaseLog.Error(string.Format("Failed to create command instance using command: {0}", command));
95                  }
# Line 327 | Line 329 | namespace AnywhereTS.DBSupport
329              }
330              catch (SqlException ex)
331              {
332 <                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())))
332 >                SqlException e = (ex.GetBaseException() as SqlException);
333 >                using (log4net.NDC.Push(string.Format("SqlException: ID={0} MESSAGE={1}{2}Diagnostics:{2}{3}", e.Number.ToString(), e.Message, System.Environment.NewLine, e.ToString())))
334                  {
335                      Logging.DatabaseLog.Error(string.Format("Failed to run script: {0}{1}", System.Environment.NewLine, strFile));
336                  }
337 <                ErrorInfo = ex;
337 >                ErrorInfo = ex; throw ErrorInfo;
338              }
339              catch (Exception ex)
340              {
341 <                using (log4net.NDC.Push(string.Format("{0}: MESSAGE={1}{2}Diagnostics:{2}{3}", ex.GetType().Name, ex.Message, System.Environment.NewLine, ex.ToString())))
341 >                Exception e = ex.GetBaseException();
342 >                using (log4net.NDC.Push(string.Format("{0}: MESSAGE={1}{2}Diagnostics:{2}{3}", e.GetType().Name, e.Message, System.Environment.NewLine, e.ToString())))
343                  {
344                      Logging.DatabaseLog.Error(string.Format("Failed to run script: {0}{1}", System.Environment.NewLine, strFile));
345                  }
346 <                ErrorInfo = ex;
346 >                ErrorInfo = ex; throw ErrorInfo;
347              }
348              return false;
349          }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines