Table of Contents

Method OnError

Namespace
Xunit.v3
Assembly
xunit.v3.core.dll

OnError(TContext, Exception)

This method is called when an exception was thrown by OnTestFinished(TContext, decimal, string, string[]?, IReadOnlyDictionary<string, TestAttachment>?). By default, this sends ErrorMessage.

protected virtual ValueTask<bool> OnError(TContext ctxt, Exception exception)

Parameters

ctxt TContext

The context that describes the current test class

exception Exception

The exception that was thrown by OnTestFinished(TContext, decimal, string, string[]?, IReadOnlyDictionary<string, TestAttachment>?).

Returns

ValueTask<bool>

Remarks

This method runs during CleaningUp. It must never throw an exception.