RESTCLIENT.NET / API REFERENCE
Outcome.Result<TSuccess, TFailure>.Error<TSuccess, TFailure>
All API types · Outcome · View source
public sealed record Error<TSuccess, TFailure>(TFailure Value) : Result<TSuccess, TFailure>
Represents a failed computation containing an error of type TFailure. This is the "sad path" case where something went wrong. In functional programming, this represents the Left side of an Either type, allowing for explicit error handling without exceptions.
| Parameter | Type | Default | Description |
|---|---|---|---|
Value |
TFailure |
Required | The error/failure value. |
Members
.ctor
public Error(TFailure Value);
Represents a failed computation containing an error of type TFailure. This is the "sad path" case where something went wrong. In functional programming, this represents the Left side of an Either type, allowing for explicit error handling without exceptions.
| Parameter | Type | Default | Description |
|---|---|---|---|
Value |
TFailure |
Required | The error/failure value. |
View source: Outcome/Error.cs:19
FromTFailure
public static Error<TSuccess, TFailure> FromTFailure(TFailure error);
Converts a failure value to an Error result. This enables clean error creation without verbose constructors.
| Parameter | Type | Default | Description |
|---|---|---|---|
error |
TFailure |
Required | The error to wrap in an Error result. |
Returns: An Error result containing the error.
View source: Outcome/Error.cs:31
ToString
public override string ToString();
Returns a string representation of the failed result.
Returns: A string representation of the error.
View source: Outcome/Error.cs:38
Value
public TFailure Value { get; init; }