/// <summary> /// Displays a dialog with exception information to the user /// </summary> /// <param name="ex">The exception</param> /// <param name="furtherMessage">Additional error messages</param> /// <param name="title">The title</param> public void Notify(Exception ex, string furtherMessage, string title) { exceptionMessage = furtherMessage + Environment.NewLine + ex.Message; if (Gizmox.WebGUI.Common.Global.Context == null) { // If the VWG Global Context has not been initialised yet, then no VWG forms can be displayed. // As a result, then best action to take is to just rethrow this error and let the ASP error handler display it. throw ex; } if (ex is UserException || ex is BusinessObjectException) { MessageBox.Show(furtherMessage + Environment.NewLine + ex.Message, title); } else { CollapsibleExceptionNotifyForm form = new CollapsibleExceptionNotifyForm(ex, furtherMessage, title); form.ShowDialog(); } }
/// <summary> /// Displays a dialog with exception information to the user /// </summary> /// <param name="ex">The exception</param> /// <param name="furtherMessage">Additional error messages</param> /// <param name="title">The title</param> public void Notify(Exception ex, string furtherMessage, string title) { //new ExceptionNotifyForm(ex, furtherMessage, title).ShowDialog(); _exceptionMessage = furtherMessage + Environment.NewLine + ex.Message; if (ex is UserException) { string message = ex.Message; if (!String.IsNullOrEmpty(furtherMessage)) { furtherMessage = furtherMessage.TrimEnd('.', ':'); message = furtherMessage + ":" + Environment.NewLine + message; } MessageBox.Show(message, title, MessageBoxButtons.OK, MessageBoxIcon.Information); } else { CollapsibleExceptionNotifyForm form = new CollapsibleExceptionNotifyForm(ex, furtherMessage, title); form.ShowDialog(); } }