public static ExceptionNode Create(Exception exception) { if (exception == null) { return(null); } return(new ExceptionNode( TypeSpec.Create(exception.GetType()), exception.Message, StackTrace.Create(new System.Diagnostics.StackTrace(exception, true)), ExceptionNode.Create(exception.InnerException))); }