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 OnTestCaseFinished(TContext, RunSummary). 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 OnTestCaseFinished(TContext, RunSummary).

Returns

ValueTask<bool>

Remarks

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