InvokeCrashed() публичный статический Метод

public static InvokeCrashed ( CrashedEventArgs e ) : void
e CrashedEventArgs
Результат void
Пример #1
0
        private static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
        {
            Console.WriteLine(e.IsTerminating ? "Error:" : "Warning:");
            Console.WriteLine(e.ExceptionObject);

            if (e.IsTerminating)
            {
                m_Crashed = true;

                bool close = false;

                try
                {
                    CrashedEventArgs args = new CrashedEventArgs(e.ExceptionObject as Exception);

                    EventSink.InvokeCrashed(args);

                    close = args.Close;
                }
                catch
                {
                }

                if (!close && !m_Service)
                {
                    Console.WriteLine("This exception is fatal, press return to exit");
                    Console.ReadLine();
                }

                m_Closing = true;
            }
        }
Пример #2
0
        private static void HandleCrashed(Exception e)
        {
            log.Error("Error: {0}", e);

            m_Crashed = true;

            bool close = false;

            try
            {
                CrashedEventArgs args = new CrashedEventArgs(e);

                EventSink.InvokeCrashed(args);

                close = args.Close;
            }
            catch
            {
            }

            if (!close && !Service)
            {
                log.Error("This exception is fatal, press return to exit");
                Console.ReadLine();
            }

            Closing = true;
        }
Пример #3
0
        private static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
        {
            if (e.IsTerminating)
            {
                log.Fatal(e);
            }
            else
            {
                log.Error(e);
            }

            if (e.IsTerminating)
            {
                m_Crashed = true;

                try
                {
                    CrashedEventArgs args = new CrashedEventArgs(e.ExceptionObject as Exception);

                    EventSink.InvokeCrashed(args);
                }
                catch
                {
                }

                m_Closing = true;
            }
        }
Пример #4
0
        private static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
        {
            CrashedEventArgs args1;

            Console.WriteLine((e.IsTerminating ? "Error:" : "Warning:"));
            Console.WriteLine(e.ExceptionObject);
            if (!e.IsTerminating)
            {
                return;
            }
            Core.m_Crashed = true;
            bool flag1 = false;

            try
            {
                args1 = new CrashedEventArgs((e.ExceptionObject as Exception));
                EventSink.InvokeCrashed(args1);
                flag1 = args1.Close;
            }
            catch
            {
            }
            if (!flag1 && !Core.m_Service)
            {
                Console.WriteLine("This exception is fatal, press return to exit");
                Console.ReadLine();
            }
        }
Пример #5
0
        private static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
        {
            Console.WriteLine(e.IsTerminating ? "Error:" : "Warning:");
            Console.WriteLine(e.ExceptionObject);

            if (!e.IsTerminating)
            {
                return;
            }

            m_Crashed = true;

            bool close = false;

            var args = new CrashedEventArgs(e.ExceptionObject as Exception);

            try
            {
                EventSink.InvokeCrashed(args);
                close = args.Close;
            }
            catch
            { }

            if (CrashedHandler != null)
            {
                try
                {
                    CrashedHandler(args);
                    close = args.Close;
                }
                catch
                { }
            }

            if (!close && !m_Service)
            {
                try
                {
                    foreach (Listener t in m_MessagePump.Listeners)
                    {
                        try
                        {
                            t.Dispose();
                        }
                        catch
                        { }
                    }
                }
                catch
                { }

                Console.WriteLine("This exception is fatal, press return to exit");
                Console.ReadLine();
            }

            Kill();
        }
Пример #6
0
        private static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
        {
            Console.WriteLine(e.IsTerminating ? "Error:" : "Warning:");
            Console.WriteLine(e.ExceptionObject);

            if (e.IsTerminating)
            {
                _Crashed = true;

                bool close = false;

                CrashedEventArgs args = new CrashedEventArgs(e.ExceptionObject as Exception);

                try
                {
                    EventSink.InvokeCrashed(args);
                    close = args.Close;
                }
                catch (Exception ex)
                {
                    Server.Diagnostics.ExceptionLogging.LogException(ex);
                }

                if (CrashedHandler != null)
                {
                    try
                    {
                        CrashedHandler(args);
                        close = args.Close;
                    }
                    catch (Exception ex)
                    {
                        Server.Diagnostics.ExceptionLogging.LogException(ex);
                    }
                }

                if (!close && !Service)
                {
                    try
                    {
                        foreach (Listener l in MessagePump.Listeners)
                        {
                            l.Dispose();
                        }
                    }
                    catch (Exception ex)
                    {
                        Server.Diagnostics.ExceptionLogging.LogException(ex);
                    }

                    Console.WriteLine("This exception is fatal, press return to exit");
                    Console.ReadLine();
                }

                Kill();
            }
        }
Пример #7
0
        private static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
        {
            Console.WriteLine(e.IsTerminating ? "Error:" : "Warning:");
            Console.WriteLine(e.ExceptionObject);

            if (e.IsTerminating)
            {
                m_Crashed = true;

                bool close = false;

                try
                {
                    CrashedEventArgs args = new CrashedEventArgs(e.ExceptionObject as Exception);

                    EventSink.InvokeCrashed(args);

                    close = args.Close;
                }
                catch
                {
                }

                if (!close && !m_Service)
                {
                    try
                    {
                        for (int i = 0; i < m_MessagePump.Listeners.Length; i++)
                        {
                            m_MessagePump.Listeners[i].Dispose();
                        }
                    }
                    catch
                    {
                    }

                    if (SocketPool.Created)
                    {
                        SocketPool.Destroy();
                    }

                    if (m_Service)
                    {
                        Console.WriteLine("This exception is fatal.");
                    }
                    else
                    {
                        Console.WriteLine("This exception is fatal, press return to exit");
                        Console.ReadLine();
                    }
                }

                m_Closing = true;
            }
        }