Table of Contents

Interface IErratic

Namespace
LfrlAnvil.Functional
Assembly
LfrlAnvil.Functional.dll

Represents a type-erased result of an action that may throw an error.

public interface IErratic
Extension Methods

Properties

HasError

Specifies whether or not this instance contains an error.

bool HasError { get; }

Property Value

bool

IsOk

Specifies whether or not this instance contains a value.

bool IsOk { get; }

Property Value

bool

Methods

GetError()

Gets the underlying error.

[Pure]
Exception GetError()

Returns

Exception

Underlying error.

Exceptions

ValueAccessException

When underlying error does not exist.

GetErrorOrDefault()

Gets the underlying error or null when it does not exist.

[Pure]
Exception? GetErrorOrDefault()

Returns

Exception

Underlying error or null when it does not exist.

GetValue()

Gets the underlying value.

[Pure]
object GetValue()

Returns

object

Underlying value.

Exceptions

ValueAccessException

When underlying value does not exist.

GetValueOrDefault()

Gets the underlying value or a default value when it does not exist.

[Pure]
object? GetValueOrDefault()

Returns

object

Underlying value or a default value when it does not exist.