ExceptionExtensions.cs
1 using System.Text;
2 
3 namespace System
4 {
5  //Utilizo el Namespace nativo System ya que agrego funcionalidad al conjunto de excepciones desde cualquier parte del programa
6 
10  public static class ExceptionExtensions
11  {
17  public static string MensajeCompleto(this Exception toEx)
18  {
19  var builder = new StringBuilder();
20  while (toEx != null)
21  {
22  builder.AppendFormat("{0}{1}", toEx.Message, Environment.NewLine);
23  toEx = toEx.InnerException;
24  }
25  return builder.ToString();
26  }
27  }
28 }