Esempio n. 1
0
 /// <summary>
 /// Writes out a flattened Exception to the PS Console
 /// </summary>
 /// <param name="exception">The exception to print</param>
 /// <param name="host">The host to print the exception information to, typically this.Host from a PSCmdlet.</param>
 internal static void WriteExceptions(Exception exception, PSHost host = null)
 {
     if (exception != null)
     {
         PSCommon.WriteExceptions(PSCommon.RecurseExceptions(new List <Exception>(), exception), host);
     }
     else
     {
         throw new ArgumentNullException("exception", "The exception cannot be null");
     }
 }
Esempio n. 2
0
 /// <summary>
 /// Writes out a flattened AggregateException to the PS Console
 /// </summary>
 /// <param name="exception">The AggregateException to print</param>
 /// <param name="host">The host to print the exception information to, typically this.Host from a PSCmdlet.</param>
 internal static void WriteExceptions(AggregateException exception, PSHost host = null)
 {
     if (exception != null)
     {
         PSCommon.WriteExceptions(PSCommon.IterateAggregate(exception), host);
     }
     else
     {
         throw new ArgumentNullException("exception", "The exception cannot be null");
     }
 }