public static void SetError(ThreadExceptionEventArgs ErrorException, string PItemError, string PAction)
        {
            ErrorDescription       = "";
            ItemError              = PItemError;
            Action                 = PAction;
            ErrorDescriptionDetial = ErrorException.Exception.ToString();
            ErrorMessage           = ErrorException.Exception.Message;

            if (ErrorException.GetType() == typeof(DbUpdateException))
            {
                ErrorDescription = SqlServerErrorManagment.ShowError(ErrorException.Exception as DbUpdateException, ItemError);
            }
            DisplayError();
        }
Esempio n. 2
0
        ///TODO: Change the invoke params to support normal Exception
        public static void ReportException(object sender, ThreadExceptionEventArgs e)
        {
            //mission critical exception, show console to user for reporting
            SessionManager.SMptr.Opacity = 100;
            SessionManager.SMptr.Show();
            EC ecn = new EC {
                EDesc = "APPLICATION EXCEPTION - " + e.GetType().Name,
                ETime = DateTime.Now,
                EType = "Fatal"
            };

            EDict.Add(ecn);
            ReportEx("APPLICATION CRITICAL EXCEPTION DIFFUSED", RType.ERROR, Color.Red, false, false, false, true);
            ReportEx("EX-> " + e.Exception.Message, RType.ERROR, RTC[3], false, false, false, true);
            ReportEx(e.Exception.StackTrace, RType.ERROR, RTC[3], false, false, false, true);
            SessionManager.SMptr.ErrorDisplay.Text = EDict.Count + " Errors";
        }