예제 #1
0
        public static void Process(IApp app, Exception exception)
        {
            if (exception is ThreadAbortException ||
                exception == null)
                return;

            lock (syncRoot)
            {
                var d = new ExceptionDialog();
                d.ExceptionMessage = exception.Message;
                d.ExceptionDetails = exception.ToString();
                d.ShowDialog(WB.Form);

                if (d.SendMail)
                {
                    var dump = new ExceptionDump(exception);
                    var sender = new DumpSender
                    {
                        To = SenderData.Recipient,
                        Credentials = new NetworkCredential(SenderData.Login, SenderData.Password)
                    };

                    if (!sender.SendDump(dump.GenerateDump(true)))
                        MessageBox.Show(sender.Error, Application.ProductName,
                            MessageBoxButtons.OK, MessageBoxIcon.Error);
                }

                Log(exception);
                app.Unload();
            }
        }
예제 #2
0
        public static void Process(IApp app, Exception exception)
        {
            if (exception is ThreadAbortException ||
                exception == null)
            {
                return;
            }

            lock (syncRoot)
            {
                var d = new ExceptionDialog();
                d.ExceptionMessage = exception.Message;
                d.ExceptionDetails = exception.ToString();
                d.ShowDialog(WB.Form);

                if (d.SendMail)
                {
                    var dump   = new ExceptionDump(exception);
                    var sender = new DumpSender
                    {
                        To          = SenderData.Recipient,
                        Credentials = new NetworkCredential(SenderData.Login, SenderData.Password)
                    };

                    if (!sender.SendDump(dump.GenerateDump(true)))
                    {
                        MessageBox.Show(sender.Error, Application.ProductName,
                                        MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                }

                Log(exception);
                app.Unload();
            }
        }