Azavea.NijPredictivePolicing.AcsAlchemistGui.MainForm.DisplayException C# (CSharp) Method

DisplayException() protected method

A very basic error display helper -- NOTE! It is up to the developer to choose what exceptions are FATAL or not. This helper is for potentially NON-FATAL exceptions / or those that can be recovered from
protected DisplayException ( string label, Exception ex ) : void
label string
ex Exception
return void
        protected void DisplayException(string label, Exception ex)
        {
            StringBuilder sb = new StringBuilder();
            sb.AppendFormat("An exception was caught during \"{0}\"{1}", label, Environment.NewLine);
            sb.AppendFormat("Message:{0}{1}{1}", ex.Message, Environment.NewLine);

            sb.Append("The program might not continue to run as expected, please restart the application");

            MessageBox.Show(sb.ToString(), "An exception was caught");
        }