- Timestamp:
- 04/08/11 11:40:48 (14 years ago)
- Location:
- trunk/sources/HeuristicLab.PluginInfrastructure/3.3/ErrorHandling
- Files:
-
- 2 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.PluginInfrastructure/3.3/ErrorHandling/ErrorHandling.cs
r5445 r5984 25 25 namespace HeuristicLab.PluginInfrastructure { 26 26 public static class ErrorHandling { 27 public static readonly string NewLine = Environment.NewLine;28 29 27 public static string BuildErrorMessage(Exception exception) { 30 28 if (exception == null) { 31 29 return string.Empty; 32 30 } else { 33 string message = exception.GetType().Name + ": " + exception.Message + NewLine +31 string message = exception.GetType().Name + ": " + exception.Message + Environment.NewLine + 34 32 exception.StackTrace; 35 33 36 34 while (exception.InnerException != null) { 37 35 exception = exception.InnerException; 38 message += NewLine +39 "-----" + NewLine +40 exception.GetType().Name + ": " + exception.Message + NewLine +36 message += Environment.NewLine + 37 "-----" + Environment.NewLine + 38 exception.GetType().Name + ": " + exception.Message + Environment.NewLine + 41 39 exception.StackTrace; 42 40 } … … 53 51 public static void ShowErrorDialog(string message, Exception exception) { 54 52 using (ErrorDialog dialog = new ErrorDialog(message, exception)) { 53 dialog.StartPosition = FormStartPosition.CenterScreen; 55 54 dialog.ShowDialog(); 56 55 }
Note: See TracChangeset
for help on using the changeset viewer.