static internal void OnWin32Error(System.Exception ex)
 {
     System.Diagnostics.Debug.WriteLine(ex.ToString());
     m_errorMessage   = ex.ToString();
     m_lastWin32Error = System.Runtime.InteropServices.Marshal.GetLastWin32Error();
     if ((((mybase_BackgroundWorker != null)) && (!mybase_BackgroundWorker.CancellationPending)))
     {
         mybase_BackgroundWorker.CancelAsync();
     }
 }
Ejemplo n.º 2
0
        protected internal void warning__(System.Exception ex)
        {
            Debug.Assert(instance_ != null);

            using (StringWriter sw = new StringWriter(CultureInfo.CurrentCulture))
            {
                IceUtilInternal.OutputBase output = new IceUtilInternal.OutputBase(sw);
                output.setUseTab(false);
                output.print("dispatch exception:");
                output.print("\nidentity: " + instance_.identityToString(current_.id));
                output.print("\nfacet: " + IceUtilInternal.StringUtil.escapeString(current_.facet, ""));
                output.print("\noperation: " + current_.operation);
                if (connection_ != null)
                {
                    Ice.ConnectionInfo connInfo = connection_.getInfo();
                    if (connInfo is Ice.IPConnectionInfo)
                    {
                        Ice.IPConnectionInfo ipConnInfo = (Ice.IPConnectionInfo)connInfo;
                        output.print("\nremote host: " + ipConnInfo.remoteAddress + " remote port: " +
                                     ipConnInfo.remotePort.ToString());
                    }
                }
                output.print("\n");
                output.print(ex.ToString());
                instance_.initializationData().logger.warning(sw.ToString());
            }
        }
        void LogException(CompileTaskResult result, System.Exception e, SyntaxNode node, out string logMessage)
        {
            logMessage = "";

            if (node != null)
            {
                FileLinePositionSpan lineSpan = node.GetLocation().GetLineSpan();

                CompileError error = new CompileError();
                error.script   = programAsset.sourceCsScript;
                error.errorStr = $"{e.GetType()}: {e.Message}";
                error.lineIdx  = lineSpan.StartLinePosition.Line;
                error.charIdx  = lineSpan.StartLinePosition.Character;

                result.compileErrors.Add(error);
            }
            else
            {
                logMessage = e.ToString();
                Debug.LogException(e);
            }
#if UDONSHARP_DEBUG
            Debug.LogException(e);
            Debug.LogError(e.StackTrace);
#endif
        }
Ejemplo n.º 4
0
        public void MarkException(Cell cell, System.Exception exception)
        {
            if (exception is IgnoredException)
            {
                return;
            }

            System.Exception abandonException = GetAbandonStoryTestException(exception);

            if (abandonException != null && IsAbandoned)
            {
                throw abandonException;
            }

            if (cell.GetAttribute(CellAttribute.Status) != Exception)
            {
                cell.SetAttribute(CellAttribute.Exception, exception.ToString());
                cell.SetAttribute(CellAttribute.Status, Exception);
                AddCount(Exception);
            }

            if (abandonException == null)
            {
                return;
            }

            IsAbandoned = true;
            throw abandonException;
        }
Ejemplo n.º 5
0
        public ExceptionWindow(System.Exception exception)
        {
            InitializeComponent();

            Exception         = exception;
            ExceptionBox.Text = exception.ToString();
        }
Ejemplo n.º 6
0
        private static void LogInitialisationError(System.Exception ex)
        {
            try
            {
                if (!EventLog.Exists(Constants.SystemLog.LogName, "."))
                {
                    var data = new EventSourceCreationData(Constants.SystemLog.EventSource, Constants.SystemLog.LogName);
                    EventLog.CreateEventSource(data);
                }

                var eventLog = new EventLog(Constants.SystemLog.LogName, ".", Constants.SystemLog.EventSource);

                string exceptionMessage;
                try
                {
                    exceptionMessage = ex.ToString();
                }
                catch (System.Exception)
                {
                    exceptionMessage = string.Format("An exception of type {0} was thrown.", ex);
                }

                eventLog.WriteEntry(typeof(ProcessDetail).FullName + " failed to initialise:" + System.Environment.NewLine
                                    + exceptionMessage, EventLogEntryType.Error);
            }
            catch (System.Exception)
            {
            }
        }
Ejemplo n.º 7
0
 public Exception(System.Exception ex)
 {
     InitializeComponent();
     _exception      = ex;
     lblContent.Text = ex.ToString();
     Activate();
 }
Ejemplo n.º 8
0
        /// <summary>
        /// 自分のローカルIPを取得する。
        /// 値が取れない場合はEmptyが返る
        /// </summary>
        public static string GetOwnIP()
        {
            System.Exception exception = new System.Exception();
            try {
                //ホスト名を取得
                string hostname = Dns.GetHostName();

                //ホスト名からIPアドレスを取得
                IPAddress [] addr_arr = Dns.GetHostAddresses(hostname);

                foreach (IPAddress addr in addr_arr)
                {
                    string addr_str         = addr.ToString();
                    bool   isIPv4           = addr_str.IndexOf(".") > 0;
                    bool   notLocalLoopback = addr_str.StartsWith("127.") == false;
                    if (isIPv4 && notLocalLoopback)
                    {
                        return(addr_str);
                    }
                }
            } catch (System.Exception e) {
                exception = e;
            }
            Msg.Gen().Set(Msg.TO, "Debug")
            .Set(Msg.ACT, "log")
            .Set(Msg.MSG, exception.ToString()).Pool();
            return(string.Empty);
        }
Ejemplo n.º 9
0
 public static void LogException(System.Exception ex)
 {
     if (ex == null)
     {
         return;
     }
     InvokeOnLog(LogType.Exception, NoTag, ex.ToString()).Forget();
 }
Ejemplo n.º 10
0
 protected BaseException(string message, System.Exception innerException)
     : base(message, innerException)
 {
     if (innerException != null)
     {
         Detail = innerException.ToString();
     }
 }
Ejemplo n.º 11
0
        /// <summary>
        /// Sends mail about the lastly occured error to the admin
        /// </summary>
        public static void ReportLastError()
        {
            System.Exception ex            = System.Web.HttpContext.Current.Server.GetLastError();
            string           logTextHeader = FormatLogText(ex.GetBaseException().Message);
            string           logTextBody   = ex.ToString();

            Emailer.SendMail("*****@*****.**", "*****@*****.**", logTextHeader, logTextBody, null);
        }
Ejemplo n.º 12
0
 public static void Exception(System.Exception exception)
 {
     Add(MessageType.Exception, exception.ToString());
     if (Application.isEditor)
     {
         Debug.LogException(exception);
     }
 }
Ejemplo n.º 13
0
        public static void Show(System.Exception ex)
        {
            LogService.LogTest(TraceLevel.Error, ex.ToString());

            var window = new ExceptionWindow(ex);

            window.ShowDialog();
        }
Ejemplo n.º 14
0
        public Exception(System.Exception ex)
        {
            InitializeComponent();
            DwmDropShadow.DropShadowToWindow(this);
            _exception = ex;

            lblContent.Text = ex.ToString();

            Activate();
        }
Ejemplo n.º 15
0
 public static void PrintStackTrace( Exception e, TextWriter writer )
 {
     writer.WriteLine( e.ToString() );
     string trace = e.StackTrace ?? string.Empty;
     foreach ( string line in trace.Split( '\n', '\r' ) )
     {
         if ( !string.IsNullOrEmpty( line ) )
             writer.WriteLine( "        " + line );
     }
 }
Ejemplo n.º 16
0
 public static void Error(System.Exception ex)
 {
     m_errorLog.WriteLine("Error in " + ex.TargetSite);
     m_errorLog.WriteLine(ex.Message);
     m_errorLog.WriteLine(ex.StackTrace);
     //TEST
     m_errorLog.WriteLine("[TEST]" + ex.ToString());
     Console("[ERROR] " + ex.Message);
     Console("[ERROR] See the error log for more information");
 }
Ejemplo n.º 17
0
 public static void LogLogRecord
     (string text01,
     System.Exception exception
     )
 {
     LogLogRecordHeader();
     MainLogStreamWriter.Write(text01);
     MainLogStreamWriter.Write(exception.ToString());
     LogLogRecordTrailer();
 }
Ejemplo n.º 18
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="e">Exception</param>
        public iFolderCrashDialog(System.Exception e) : base()
        {
            this.SetDefaultSize(600, 400);
            this.Title        = "";
            this.HasSeparator = false;
//			this.BorderWidth = 10;
            this.Resizable = true;


            this.Icon = new Gdk.Pixbuf(Util.ImagesPath("ifolder-error16.png"));

            Image crashImage = new Image(Util.ImagesPath("ifolder-error48.png"));

            VBox vbox = new VBox();

            vbox.BorderWidth = 10;
            vbox.Spacing     = 10;

            Label l = new Label("<span weight=\"bold\" size=\"larger\">" +
                                Util.GS("iFolder crashed because of an unhandled exception") +
                                "</span>");

            l.LineWrap   = false;
            l.UseMarkup  = true;
            l.Selectable = false;
            l.Xalign     = 0; l.Yalign = 0;
            vbox.PackStart(l, false, false, 0);

            HBox h = new HBox();

            h.BorderWidth = 10;
            h.Spacing     = 12;

            crashImage.SetAlignment(0.5F, 0);
            h.PackStart(crashImage, false, false, 0);

            TextView tv = new TextView();

            tv.WrapMode = Gtk.WrapMode.Word;
            tv.Editable = false;


            tv.Buffer.Text = e.ToString();
            ScrolledWindow sw = new ScrolledWindow();

            sw.ShadowType = Gtk.ShadowType.EtchedIn;
            sw.Add(tv);
            h.PackEnd(sw, true, true, 0);

            vbox.PackEnd(h);
            vbox.ShowAll();
            this.VBox.Add(vbox);

            this.AddButton(Stock.Close, ResponseType.Ok);
        }
Ejemplo n.º 19
0
 /// <summary>
 /// Logs the exception.
 /// </summary>
 /// <param name="exception">The exception.</param>
 /// <param name="priority">The priority.</param>
 /// <param name="className">Name of the class.</param>
 /// <param name="methodName">Name of the method.</param>
 public static void LogException(System.Exception exception, LogPriorityID priority = LogPriorityID.High, string className = "NotAvailable", string methodName = "NotAvailable")
 {
     Log(
         exception.ToString(),
         LoggingCategory.Error,
         priority,
         System.Diagnostics.TraceEventType.Error,
         className,
         methodName,
         0);
 }
Ejemplo n.º 20
0
        public virtual void  fireReportError(System.Exception e)
        {
            MessageEventHandler eventDelegate = (MessageEventHandler)((CharScanner)source).Events[Parser.ReportErrorEventKey];

            if (eventDelegate != null)
            {
                messageEvent.setValues(MessageEventArgs.ERROR, e.ToString());
                eventDelegate(source, messageEvent);
            }
            checkController();
        }
Ejemplo n.º 21
0
 private void terminal1_CommandException(object sender, System.Exception e)
 {
     if (e is CommandNotFoundException)
     {
         terminal1.WriteText(e.Message, Color.Red, FontStyle.Bold);
     }
     else
     {
         terminal1.WriteText(e.ToString(), Color.Red, FontStyle.Bold);
     }
 }
Ejemplo n.º 22
0
        public static Obj Error_P(RelAutoBase automaton, RelAutoUpdaterBase updater, object env)
        {
            Exception e   = updater.lastException;
            string    msg = "";

            if (e != null)
            {
                if (e is KeyViolationException || e is ForeignKeyViolationException)
                {
                    msg = e.ToString();
                }
                else
                {
                    DataWriter writer = IO.StringDataWriter();
                    writer.Write(e.ToString());
                    writer.Flush();
                    msg = writer.Output();
                }
            }
            return(Conversions.StringToObj(msg));
        }
Ejemplo n.º 23
0
        private static Task HandleExceptionAsync(HttpContext context, System.Exception ex)
        {
            ResponseResult responseResult = new ResponseResult
            {
                State   = false,
                Message = ex.ToString()
            };
            var result = JsonConvert.SerializeObject(responseResult);

            context.Response.ContentType = "application/json;charset=utf-8";
            return(context.Response.WriteAsync(result));
        }
        public static void PrintStackTrace(Exception e, TextWriter writer)
        {
            writer.WriteLine(e.ToString());
            string trace = e.StackTrace ?? string.Empty;

            foreach (string line in trace.Split('\n', '\r'))
            {
                if (!string.IsNullOrEmpty(line))
                {
                    writer.WriteLine("        " + line);
                }
            }
        }
Ejemplo n.º 25
0
 public static void LogException(string tag, System.Exception ex)
 {
     if (ex == null)
     {
         return;
     }
     if (LogManager.IsLoggerFactoryDisposed)
     {
         Debug.LogError($"[{tag}] {ex}");
         return;
     }
     LogManager.GetLogger(tag).LogError(ex.ToString());
 }
Ejemplo n.º 26
0
 /// <inheritdoc />
 /// <summary>
 /// Log a system exception.
 /// </summary>
 /// <param name="exception"></param>
 public void LogException(System.Exception exception)
 {
     while (true)
     {
         LogMessageToEngine(exception.ToString(), LogLevels.Exception);
         if (exception.InnerException != null)
         {
             exception = exception.InnerException;
             continue;
         }
         break;
     }
 }
Ejemplo n.º 27
0
        private void btnReportToGithub_Click(object sender, RoutedEventArgs e)
        {
            string       title  = HttpUtility.HtmlEncode(_exception.Message);
            string       body   = HttpUtility.HtmlEncode(_exception.ToString());
            const string labels = "bug";

            string githubIssueCreate =
                string.Format("https://github.com/XboxChaos/Assembly/issues/new?title={0}&body={1}&labels={2}",
                              title, body, labels);

            btnReportToGithub.IsEnabled = false;
            Process.Start(githubIssueCreate);
        }
Ejemplo n.º 28
0
        private void OnGUI()
        {
            if (HasLoaded)
            {
                return;
            }

            // background

            if (CurrentSplashTex != null)
            {
                GUIUtils.DrawTextureWithYFlipped(new Rect(0, 0, Screen.width, Screen.height), CurrentSplashTex);
            }
            else
            {
                GUIUtils.DrawRect(new Rect(0, 0, Screen.width, Screen.height), Color.black);
            }

            // display loading progress

            GUILayout.BeginArea(new Rect(10, 5, 400, Screen.height - 5));

            // current status
            GUILayout.Label("<size=25>" + LoadingStatus + "</size>");

            // progress bar
            GUILayout.Space(10);
            DisplayProgressBar();

            // display error
            if (m_hasErrors)
            {
                GUILayout.Space(20);
                GUILayout.Label("<size=20>" + "The following exception occured during the current step:" + "</size>");
                GUILayout.TextArea(m_loadException.ToString());
                GUILayout.Space(30);
                if (GUIUtils.ButtonWithCalculatedSize("Exit", 80, 30))
                {
                    GameManager.ExitApplication();
                }
                GUILayout.Space(5);
            }

            // display all steps
//			GUILayout.Space (10);
//			DisplayAllSteps ();

            GUILayout.EndArea();

            DisplayFileBrowser();
        }
Ejemplo n.º 29
0
        public bool HasError()
        {
            if (ex == null)
            {
                return(false);
            }

            if (ex.ToString().Length > 0)
            {
                return(true);
            }

            return(false);
        }
Ejemplo n.º 30
0
        private static void FilteredLog(ILogger logger, LogLevel level, string message, System.Exception exception = null, User user = null)
        {
            //don't log thread abort exception
            if (exception is System.Threading.ThreadAbortException)
            {
                return;
            }

            if (logger.IsEnabled(level))
            {
                var fullMessage = exception == null ? string.Empty : exception.ToString();
                logger.InsertLog(level, message, fullMessage, user);
            }
        }
Ejemplo n.º 31
0
        /** s_AssertProc
         */
                #if (DEF_BLUEBACK_JSONITEM_ASSERT)
        public static void DefaultAssertProc(System.Exception a_exception, string a_message)
        {
            if (a_message != null)
            {
                UnityEngine.Debug.LogError(a_message);
            }

            if (a_exception != null)
            {
                UnityEngine.Debug.LogError(a_exception.ToString());
            }

            UnityEngine.Debug.Assert(false);
        }
Ejemplo n.º 32
0
        private static Protobuf.Exception GetExceptionResponse(Exception exc)
        {
            Alachisoft.NCache.Common.Protobuf.Exception ex = new Alachisoft.NCache.Common.Protobuf.Exception();
            ex.message = exc.Message;
            ex.exception = exc.ToString();

            if (exc is OperationFailedException)
                ex.type = Alachisoft.NCache.Common.Protobuf.Exception.Type.OPERATIONFAILED;
            else if (exc is Runtime.Exceptions.AggregateException)
                ex.type = Alachisoft.NCache.Common.Protobuf.Exception.Type.AGGREGATE;
            else if (exc is ConfigurationException)
                ex.type = Alachisoft.NCache.Common.Protobuf.Exception.Type.CONFIGURATION;
            else if (exc is OperationNotSupportedException)
                ex.type = Alachisoft.NCache.Common.Protobuf.Exception.Type.NOTSUPPORTED;
            else if (exc is TypeIndexNotDefined)
                ex.type = Alachisoft.NCache.Common.Protobuf.Exception.Type.TYPE_INDEX_NOT_FOUND;
            else if (exc is AttributeIndexNotDefined)
                ex.type = Alachisoft.NCache.Common.Protobuf.Exception.Type.ATTRIBUTE_INDEX_NOT_FOUND;
            else if (exc is StateTransferInProgressException)
                ex.type = Alachisoft.NCache.Common.Protobuf.Exception.Type.STATE_TRANSFER_EXCEPTION;
            else
                ex.type = Alachisoft.NCache.Common.Protobuf.Exception.Type.GENERALFAILURE;
            return ex;
        }