Exemplo n.º 1
0
        /// <summary>
        /// notify the user about an Exception.
        /// </summary>
        /// <param name="argMessage">
        /// general description of where the Exception occurred.
        /// </param>
        /// <param name="ex">
        /// Exception object.
        /// </param>
        public void NotifyException(string argMessage, Exception ex)
        {
            if (ex is null)
            {
                throw new ArgumentNullException(nameof(ex));
            }

            string exceptionMessage = argMessage + " - Exception:" + ex.Message + " - " + ex.Source + " - " + ex.InnerException + " - " + ex.StackTrace;

            NotifyError(exceptionMessage);

            CommonLogging.LogException(argMessage, ex);

            // Remove serialised data in case it is the issue
            CommonLocalSettings.DataSerialised = false;
        }
Exemplo n.º 2
0
        /// <summary>
        /// Notifies the user of an error and logs it for further analysis.
        /// </summary>
        /// <param name="argMessage">
        /// The argument message.
        /// </param>
        /// <param name="argErrorDetail">
        /// The argument error detail.
        /// </param>
        public void NotifyDialogBox(string argHeader, string argMessage, Dictionary <string, string> argErrorDetail)
        {
            if (argErrorDetail is null)
            {
                argErrorDetail = new Dictionary <string, string>();
            }

            ActionDialogArgs t = new ActionDialogArgs
            {
                Name = argHeader,
                Text = argMessage
            };

            NotifyDialogBox(t);

            MajorStatusAdd(argMessage);

            argErrorDetail.Add("Error", argMessage);

            CommonLogging.LogError(argMessage, argErrorDetail);
        }