Table of Contents

Class ExceptionUtility

Namespace
Xunit.Sdk

Utility class for dealing with Exception and IErrorMetadata objects.

public static class ExceptionUtility
Inheritance
ExceptionUtility
Inherited Members

Methods

CombineMessages(IErrorMetadata)

Combines multiple levels of messages into a single message.

public static string CombineMessages(IErrorMetadata errorMetadata)

Parameters

errorMetadata IErrorMetadata

The error metadata from which to get the messages.

Returns

string

The combined string.

CombineStackTraces(IErrorMetadata)

Combines multiple levels of stack traces into a single stack trace.

public static string? CombineStackTraces(IErrorMetadata errorMetadata)

Parameters

errorMetadata IErrorMetadata

The error metadata from which to get the stack traces.

Returns

string

The combined string.

ExtractMetadata(Exception)

Unwraps exceptions and their inner exceptions.

public static (string?[] ExceptionTypes, string[] Messages, string?[] StackTraces, int[] ExceptionParentIndices, FailureCause Cause) ExtractMetadata(Exception ex)

Parameters

ex Exception

The exception to be converted.

Returns

(string[] ExceptionTypes, string[] Messages, string[] StackTraces, int[] ExceptionParentIndices, FailureCause Cause)

The error metadata.