<PackageReference Include="NUnit" Version="3.5.0" />

ExceptionHelper

public class ExceptionHelper
ExceptionHelper provides static methods for working with exceptions
public ExceptionHelper()

public static string BuildMessage(Exception exception)

Builds up a message, using the Message field of the specified exception as well as any InnerExceptions.

public static string BuildStackTrace(Exception exception)

Builds up a message, using the Message field of the specified exception as well as any InnerExceptions.

public static string GetStackTrace(Exception exception)

Gets the stack trace of the exception.

public static void Rethrow(Exception exception)

Rethrows an exception, preserving its stack trace