OptTThrowIfNone(String) Method
Returns the option back when
IsSome; throws a NullReferenceException when
IsNone.
Appends the
errorMessage to the exception if the message
IsSome.
Can be called without breaking the flow of chained operations.
var interestRate = GetOptionalUser(input)
.ThrowIfNone("failed to get the user")
.Map(user => ComputeInterestRate(user))
.Unwrap();
Namespace: Orx.Fun.OptionAssembly: Orx.Fun.Option (in Orx.Fun.Option.dll) Version: 1.2.1+ea79806fa5e0e04bfdaef2a1916930e75e2cde74
public Opt<T> ThrowIfNone(
string errorMessage
)
- errorMessage String
- Optional message to append to the exception message.
OptT