hMailServer.Administrator.Program.currentDomain_ThreadException C# (CSharp) Method

currentDomain_ThreadException() private static method

private static currentDomain_ThreadException ( object sender, ThreadExceptionEventArgs t ) : void
sender object
t System.Threading.ThreadExceptionEventArgs
return void
        private static void currentDomain_ThreadException(object sender, ThreadExceptionEventArgs t)
        {
            System.Runtime.InteropServices.COMException comEx = t.Exception as System.Runtime.InteropServices.COMException;

             if (comEx != null)
             {
            // RPC server fault.
            if (comEx.ErrorCode == -2147417851 || comEx.ErrorCode == -2147023174)
            {
               // Connection
               HandleConnectionLost();
               return;
            }
             }

             formErrorMessage dialog = new formErrorMessage(t);
             dialog.ShowDialog();

             Instances.MainForm.Repaint();
        }