ExceptionExtensions Class

Provides extension methods for Exception.

public static class ExceptionExtensions

Methods

NameDescription
ToString(Exception, bool)Converts the exception to a string representation, optionally including all inner exceptions.

ToString(Exception, bool)

ExceptionExtensions.cs

Converts the exception to a string representation, optionally including all inner exceptions.

public static string ToString(this Exception exception, bool includeInnerException)

Parameters

exception Exception
The exception to convert.
includeInnerException bool
true to return Exception.ToString, which includes the inner exceptions; false to return only the type, message and stack trace of exception.

Returns

string