ExceptionMatch<R> Class

Pattern matching for exceptions. This is to aid expression based error handling.

DECLARATION
[Serializable]
public class ExceptionMatch<R>
NAMESPACE
LanguageExt

Methods

Otherwise(R)
SUMMARY

Invokes the match expression and provides a default value if nothing matches

PARAMETERS
otherwiseValue
R
Default value
DECLARATION
[Pure]
public R Otherwise(R otherwiseValue)
RETURNS
R
Result of the expression
Otherwise(Func<R>)
SUMMARY

Invokes the match expression and provides a default function to invoke if nothing matches

PARAMETERS
otherwise
Func<R>
Default value
DECLARATION
[Pure]
public R Otherwise(Func<R> otherwise)
RETURNS
R
Result of the expression
Otherwise(Func<Exception, R>)
SUMMARY

Invokes the match expression and provides a default function to invoke if nothing matches

PARAMETERS
otherwiseMap
Func<Exception, R>
Default value
DECLARATION
[Pure]
public R Otherwise(Func<Exception, R> otherwiseMap)
RETURNS
R
Result of the expression
OtherwiseReThrow()
SUMMARY

Invokes the match expression and provides a default value if nothing matches

DECLARATION
[Pure]
public R OtherwiseReThrow()
RETURNS
R
Result of the expression
With<TException>(Func<TException, R>)
SUMMARY

Matches a typed exception with a mapping function

PARAMETERS
map
Func<TException, R>
Function to map the exception to a result value
DECLARATION
[Pure]
public ExceptionMatch<R> With<TException>(Func<TException, R> map)
RETURNS
ExceptionMatch<R>
Matching context - you must use 'Otherwise()' to invoke
CONSTRAINTS
where TException : Exception