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

ExceptionExtensions

static class ExceptionExtensions
public static Result<IDictionary> GetDataWithoutThrowing(this Exception exception)

If Data throws, returns "SomeException was thrown by the Exception.Data property."

public static string GetMessageWithoutThrowing(this Exception exception)

If Message throws, returns "SomeException was thrown by the Exception.Message property."

public static string GetStackTraceWithoutThrowing(this Exception exception)

If StackTrace throws, returns "SomeException was thrown by the Exception.StackTrace property." See also GetEnvironmentStackTraceWithoutThrowing.