Esempio n. 1
0
        private void OnUnhandledException(GLib.UnhandledExceptionArgs args)
        {
            UnhandledExceptionDialog exDialog = new UnhandledExceptionDialog((Exception)args.ExceptionObject);

            exDialog.Run();
            args.ExitApplication = true;
        }
Esempio n. 2
0
        public static void OnUnhandledException(GLib.UnhandledExceptionArgs args)
        {
            Exception e = (Exception)args.ExceptionObject;

            OnUnhandledException(e);
            args.ExitApplication = true;
        }
Esempio n. 3
0
 private static void ExceptionManager_UnhandledException(GLib.UnhandledExceptionArgs args)
 {
     if (args.ExceptionObject is Exception ex)
     {
         XTrace.WriteException(ex);
     }
 }
Esempio n. 4
0
        static void HandleUnhandledGlibTestingException(GLib.UnhandledExceptionArgs e)
        {
            HandleTestingException(e.ExceptionObject as Exception);

            mLog.ErrorFormat("The runtime is terminating [{0}]", e.IsTerminating);
            e.ExitApplication = false;
        }
Esempio n. 5
0
        private static void ExceptionManager_UnhandledException(GLib.UnhandledExceptionArgs args)
        {
            Exception ex = (Exception)args.ExceptionObject;

            PintaCore.Chrome.ShowErrorDialog(PintaCore.Chrome.MainWindow,
                                             string.Format("{0}:\n{1}", "Unhandled exception", ex.Message),
                                             ex.ToString());
        }
Esempio n. 6
0
        static void OnUnhandledException(GLib.UnhandledExceptionArgs args)
        {
            var    ex  = (Exception)args.ExceptionObject;
            string txt = "GLib.UnhandledException:\n" + ex.Message + "\n\n" + ex.ToString();

            Console.Error.WriteLine(txt);
            ErrorMsg("Serious Error. Select & copy text.", txt);

            args.ExitApplication = true;
        }
Esempio n. 7
0
        private static void Glib_UnhandledException(GLib.UnhandledExceptionArgs e)
        {
            Exception exception = e.ExceptionObject as Exception;

            Logger.PrintError(LogClass.Application, $"Unhandled exception caught: {exception}");

            if (e.IsTerminating)
            {
                Logger.Shutdown();
            }
        }
Esempio n. 8
0
        private static void _OnUnhandledException(GLib.UnhandledExceptionArgs e)
        {
            Trace.CallFull(e);

            lock (_UnhandledExceptionSyncRoot) {
                if (e.ExceptionObject is Exception)
                {
                    ShowException((Exception)e.ExceptionObject);
                }
            }
        }
Esempio n. 9
0
        public static void HandleException(GLib.UnhandledExceptionArgs args)
        {
            var exception = args.ExceptionObject as Exception;

            Console.WriteLine(exception.StackTrace);
            var           message = exception.Message;
            MessageDialog md      = new MessageDialog(null, DialogFlags.DestroyWithParent, MessageType.Info, ButtonsType.Ok, message);

            md.SetPosition(WindowPosition.Center);
            md.Run();
            md.Destroy();
        }
Esempio n. 10
0
 private static void ExceptionManager_UnhandledException(GLib.UnhandledExceptionArgs args)
 {
     if (args.ExceptionObject is Exception e)
     {
         if (e is TargetInvocationException tie && tie.InnerException != null)
         {
             throw tie.InnerException;
         }
         else
         {
             throw e;
         }
     }
Esempio n. 11
0
        private static void UnhandledGLibExceptionHandler(GLib.UnhandledExceptionArgs args)
        {
            string exceptionText = args.ExceptionObject.ToString();

            Console.Error.WriteLine("UNHANDLED EXCEPTION!! " + exceptionText);
            string crashFileName = Path.Combine(Environment.GetFolderPath(System.Environment.SpecialFolder.Desktop), string.Format("meshwork-crash-{0}.log", DateTime.Now.ToFileTime()));
            string crashLog      = exceptionText;

            File.WriteAllText(crashFileName, crashLog);

            Gui.ShowErrorDialog("Meshwork has encountered an unhandled error and must be closed.\n\nAn error report has been created on your desktop, please file a bug.\n\n" + exceptionText);

            args.ExitApplication = true;
        }
Esempio n. 12
0
        private static void ExceptionManager_UnhandledException(GLib.UnhandledExceptionArgs args)
        {
            ErrorDialog errorDialog = new ErrorDialog(null);

            Exception ex = (Exception)args.ExceptionObject;

            try {
                errorDialog.Message = string.Format("{0}:\n{1}", "Unhandled exception", ex.Message);
                errorDialog.AddDetails(ex.ToString(), false);
                errorDialog.Run();
            } finally {
                errorDialog.Destroy();
            }
        }
Esempio n. 13
0
        void ExceptionManager_UnhandledException(GLib.UnhandledExceptionArgs args)
        {
            string    msg = "Unhandled unknown exception";
            Exception exc = args.ExceptionObject as Exception;

            if (exc != null)
            {
                msg = "Outer exception:\n" + exc.Message + "\n";
                if (exc.InnerException != null)
                {
                    msg += "Inner exception:\n" + exc.InnerException.Message + "\n";
                }
            }
            Guppy.Message("UNHANDLED EXCEPTION", "An unhandled fatal exception occured in the program:\n" + msg);
            args.ExitApplication = false;
        }
Esempio n. 14
0
        static void HandleUnhandledGlibException(GLib.UnhandledExceptionArgs e)
        {
            // Here you'd usually log the exception, send telemetry events...
            mLog.ErrorFormat("The runtime is terminating [{0}]", e.IsTerminating);
            e.ExitApplication = false;

            Exception ex = e.ExceptionObject as Exception;

            if (ex == null)
            {
                return;
            }

            Console.Error.WriteLine(ex.Message);
            Console.Error.WriteLine(ex.StackTrace);
        }
Esempio n. 15
0
        private static void ExceptionManager_UnhandledException(GLib.UnhandledExceptionArgs args)
        {
            ErrorDialog errorDialog = new ErrorDialog(null);

            Exception ex = (Exception)args.ExceptionObject;

            try
            {
                errorDialog.Message = string.Format("{0}:\n{1}", "Unhandled exception", ex.Message);
                errorDialog.AddDetails(ex.ToString(), false);
                errorDialog.Run();
            }
            finally
            {
                errorDialog.Destroy();
                TraceLab.Core.ViewModels.LogViewModel.DestroyLogTargets();
                Application.Quit();
            }
        }
Esempio n. 16
0
        static void HandleUnhandledException(GLib.UnhandledExceptionArgs args)
        {
            Exception ex   = args.ExceptionObject as Exception;
            string    text = String.Format(Mono.Unix.Catalog.GetString("An unhandled exception has been thrown. Please, send this error report to your software maintainer in order to prevent more errors in the future.\n\n{0}: {1}\n{2}"), ex.InnerException.GetType().ToString(), ex.InnerException.Message.ToString(), ex.InnerException.StackTrace.ToString());

            Gtk.MessageDialog msg = new MessageDialog(null, DialogFlags.Modal, MessageType.Error, ButtonsType.Ok, text);
            msg.UseMarkup = false;
            msg.Title     = Mono.Unix.Catalog.GetString("Unhandled exception thrown in Secretaria Electrial");
            if ((ResponseType)msg.Run() == ResponseType.Ok)
            {
                Emailer em = new Emailer(x =>
                {
                });
                em.Subject = "Unhandled exception thrown in Secretaria Electrial";
                em.Body    = text;
                em.Execute();
            }
            msg.Destroy();
        }
Esempio n. 17
0
        static void HandleUnhandledException(GLib.UnhandledExceptionArgs args)
        {
            var log = new GLib.Log();

            string exObjFullName = args.ExceptionObject.GetType().FullName;

            var    ex    = args.ExceptionObject as Exception;
            string exMsg = object.ReferenceEquals(ex, null) ?
                           "(Exception object is not an Exception)" :
                           ex.Message;

            log.WriteLog(null, GLib.LogLevelFlags.Critical,
                         "Caught unhandled exception of type {0}: {1}",
                         exObjFullName, exMsg);
            Debug.Print("Stack trace:{0}{1}", Environment.NewLine, Environment.StackTrace);

            var dialog = new MessageDialog(
                null, DialogFlags.Modal, MessageType.Error, ButtonsType.OkCancel,
                "Caught unhandled exception of type {0}: {1}" +
                Environment.NewLine + Environment.NewLine +
                "Terminate? (Hit cancel to try to continue...)",
                exObjFullName, exMsg);
            int result = dialog.Run();

            dialog.Destroy();

            if (result == (int)ResponseType.Ok)
            {
                log.WriteLog(null, GLib.LogLevelFlags.Warning, "User decided to terminate the application.");
                args.ExitApplication = true;
            }
            else
            {
                log.WriteLog(null, GLib.LogLevelFlags.Warning, "Trying to continue on user request...");
                args.ExitApplication = false;
            }
        }
 private static void HandleGLibUnhandledException(GLib.UnhandledExceptionArgs args)
 {
     OnDomainUnhandledException(null, args);
 }
Esempio n. 19
0
 /// <summary>
 /// Passes any unhandled exceptions from the GTK UI to the generic handler.
 /// </summary>
 /// <param name="args">The event object containing the information about the exception.</param>
 private static void OnGLibUnhandledException(GLib.UnhandledExceptionArgs args)
 {
     OnUnhandledException(null, new UnhandledExceptionEventArgs(args.ExceptionObject, args.IsTerminating));
 }
Esempio n. 20
0
 static void HandleException(GLib.UnhandledExceptionArgs args)
 {
     args.ExitApplication = false;
     exceptionHappened    = (Exception)args.ExceptionObject;
     lastHandle.Set();
 }
Esempio n. 21
0
 private static void OnException(GLib.UnhandledExceptionArgs args)
 {
     ProcessExecutionError((Exception)args.ExceptionObject);
 }
 static void OnException(GLib.UnhandledExceptionArgs args)
 {
     Debug.WriteLine("Glib error error {0}", args.ExceptionObject.ToString());
     args.ExitApplication = false;
 }
Esempio n. 23
0
 private static void ExceptionManager_UnhandledException(GLib.UnhandledExceptionArgs args)
 {
     Log.Debug("GLib ExceptionManager_UnhandledException: " + args.ExceptionObject);
     args.ExitApplication = false;
 }
        static void unhandledException(GLib.UnhandledExceptionArgs args)
        {
            Exception ex = (Exception)args.ExceptionObject;

            if (ex.Message == "Exception has been thrown by the target of an invocation.")
            {
                ex = ex.InnerException;
            }
            ResponseType ret = showErrDialog(ex, !args.IsTerminating);

            if (ret == ResponseType.Ok)
            {
                string sRet = MantisReporter.ReportIssue(ex);
                if (sRet == "OK")
                {
                    if (modFunctions.ShowMessageBox(null, "Thank you for reporting the error.\nYou can find details on the Bug Report page.\n\nDo you wish to visit the Bug Report?", modFunctions.ProductName + " Error Report Sent!", (DialogFlags)0, MessageType.Question, ButtonsType.YesNo) == ResponseType.Yes)
                    {
                        System.Diagnostics.Process.Start("http://bugs.realityripple.com/set_project.php?project_id=2");
                    }
                }
                else
                {
                    string sErrRep = "http://bugs.realityripple.com/set_project.php?project_id=2&make_default=no&ref=bug_report_page.php";
                    if (CurrentOS.Is32bit)
                    {
                        sErrRep += "?platform=x86";
                    }
                    else if (CurrentOS.Is64bit)
                    {
                        if (CurrentOS.Is32BitProcess)
                        {
                            sErrRep += "?platform=x86-64";
                        }
                        else if (CurrentOS.Is64BitProcess)
                        {
                            sErrRep += "?platform=x64";
                        }
                        else
                        {
                            sErrRep += "?platform=x86 OS, Unknown Process";
                        }
                    }
                    else
                    {
                        sErrRep += "?platform=Unknown";
                    }
                    sErrRep += "%2526os=" + DoubleEncode(CurrentOS.Name);
                    sErrRep += "%2526os_build=" + DoubleEncode(Environment.OSVersion.VersionString);
                    sErrRep += "%2526product_version=" + DoubleEncode(modFunctions.ProductVersion);
                    string sDesc = ex.Message;
                    string sSum  = sDesc;
                    if (sSum.Length > 80)
                    {
                        sSum = sSum.Substring(0, 77) + "...";
                    }
                    sErrRep += "%2526summary=" + DoubleEncode(sSum);
                    if (!string.IsNullOrEmpty(ex.StackTrace))
                    {
                        sDesc += "\n" + ex.StackTrace.Substring(0, ex.StackTrace.IndexOf("\n"));
                    }
                    else
                    {
                        if (!string.IsNullOrEmpty(ex.Source))
                        {
                            sDesc += "\n @ " + ex.Source;
                            if (ex.TargetSite != null)
                            {
                                sDesc += "." + ex.TargetSite.Name;
                            }
                        }
                        else
                        {
                            if (ex.TargetSite != null)
                            {
                                sDesc += "\n @ " + ex.TargetSite.Name;
                            }
                        }
                    }
                    sErrRep += "%2526description=" + DoubleEncode(sDesc);
                    if (modFunctions.ShowMessageBox(null, sRet + "\n\nWould you like to report the error manually?", modFunctions.ProductName + " Error Report Failed!", (DialogFlags)0, MessageType.Error, ButtonsType.YesNo) == ResponseType.Yes)
                    {
                        System.Diagnostics.Process.Start(sErrRep);
                    }
                }
            }
            else if (ret == ResponseType.Reject)
            {
                Application.Quit();
            }
        }
Esempio n. 25
0
        void OnUnhandledException(GLib.UnhandledExceptionArgs e)
        {
            var unhandledExceptionArgs = new UnhandledExceptionEventArgs(e.ExceptionObject, e.IsTerminating);

            Callback.OnUnhandledException(Widget, unhandledExceptionArgs);
        }
Esempio n. 26
0
 /// <summary>
 /// Passes any unhandled exceptions from the GTK UI to the generic handler.
 /// </summary>
 /// <param name="args">The event object containing the information about the exception.</param>
 private static void OnGLibUnhandledException(GLib.UnhandledExceptionArgs args)
 {
     OnUnhandledException(null, args);
 }
 static void ExceptionManager_UnhandledException(GLib.UnhandledExceptionArgs args)
 {
     Console.WriteLine("Unhandled exception");
 }
Esempio n. 28
0
 static void OnException(GLib.UnhandledExceptionArgs args)
 {
     CatalogApi.Logging.Info(string.Format("Glib error error {0}", args.ExceptionObject.ToString()));
     args.ExitApplication = false;
 }
 private void OnGtkException(GLib.UnhandledExceptionArgs a)
 {
     logger.Fatal((Exception)a.ExceptionObject, "Поймано необработаное исключение в GTK.");
     ErrorMessage((Exception)a.ExceptionObject);
 }