Struct Outcome

Namespace
Kevlar
Assembly
Kevlar.dll

The result of a void execution: either success or a captured exception.

public readonly struct Outcome
Inherited Members

Properties

Exception

The captured exception, or null when execution succeeded.

public Exception? Exception { get; }

Property Value

Exception

IsSuccess

true when execution completed without an exception.

public bool IsSuccess { get; }

Property Value

bool

Success

Gets a successful void outcome.

public static Outcome Success { get; }

Property Value

Outcome

Methods

FromException(Exception)

Creates an outcome holding a captured exception.

public static Outcome FromException(Exception exception)

Parameters

exception Exception

Returns

Outcome

Rethrow()

Rethrows the captured exception with its original stack trace preserved.

public void Rethrow()

ToString()

public override string ToString()

Returns

string