Contents
- ExceptionMatch <R>
 - With <TException> (Func<TException, R> map)
 - OtherwiseReThrow ()
 - Otherwise (R otherwiseValue)
 - Otherwise (Func<R> otherwise)
 - Otherwise (Func<Exception, R> otherwiseMap)
 - ExceptionExtensions
 - Match <R> (this Exception self)
 - Rethrow (this Exception exception)
 - Rethrow <A> (this Exception exception)
 - ExceptionMatchAsync <R>
 - With <TException> (Func<TException, R> map)
 - OtherwiseReThrow ()
 - Otherwise (R otherwiseValue)
 - Otherwise (Func<R> otherwise)
 - Otherwise (Func<Exception, R> otherwiseMap)
 - ExceptionAsyncExtensions
 - ExceptionMatchOptionalAsync <R>
 - With <TException> (Func<TException, R> map)
 - OtherwiseReThrow ()
 - Otherwise (R otherwiseValue)
 - Otherwise (Func<R> otherwise)
 - Otherwise (Func<Exception, R> otherwiseMap)
 - ExceptionOptionalAsyncExtensions
 
class ExceptionMatch <R> Source #
Pattern matching for exceptions. This is to aid expression based error handling.
Examples
ex.Match<string>()
  .With<SystemException>(e => "It's a system exception")
  .With<ArgumentNullException>(e => "Arg null")
  .Otherwise("Not handled")
Methods
method ExceptionMatch<R> With <TException> (Func<TException, R> map) Source #
Matches a typed exception with a mapping function
Parameters
| type | TException | |
| param | map | Function to map the exception to a result value  | 
| returns | Matching context - you must use 'Otherwise()' to invoke  | |
method R OtherwiseReThrow () Source #
Invokes the match expression and provides a default value if nothing matches
Parameters
| returns | Result of the expression  | |
method R Otherwise (R otherwiseValue) Source #
Invokes the match expression and provides a default value if nothing matches
Parameters
| param | otherwiseValue | Default value  | 
| returns | Result of the expression  | |
class ExceptionExtensions Source #
Exception extensions
Methods
method LanguageExt.ExceptionMatch<R> Match <R> (this Exception self) Source #
Pattern matching for exceptions. This is to aid expression based error handling.
Examples
ex.Match<string>()
  .With<SystemException>(e => "It's a system exception")
  .With<ArgumentNullException>(e => "Arg null")
  .Otherwise("Not handled")
class ExceptionMatchAsync <R> Source #
Pattern matching for exceptions. This is to aid expression based error handling.
Examples
ex.Match<string>()
  .With<SystemException>(e => "It's a system exception")
  .With<ArgumentNullException>(e => "Arg null")
  .Otherwise("Not handled")
Methods
method ExceptionMatchAsync<R> With <TException> (Func<TException, R> map) Source #
Matches a typed exception with a mapping function
Parameters
| type | TException | |
| param | map | Function to map the exception to a result value  | 
| returns | Matching context - you must use 'Otherwise()' to invoke  | |
method Task<R> OtherwiseReThrow () Source #
Invokes the match expression and provides a default value if nothing matches
Parameters
| returns | Result of the expression  | |
method Task<R> Otherwise (R otherwiseValue) Source #
Invokes the match expression and provides a default value if nothing matches
Parameters
| param | otherwiseValue | Default value  | 
| returns | Result of the expression  | |
class ExceptionAsyncExtensions Source #
Exception extensions
Methods
method LanguageExt.ExceptionMatchAsync<R> Match <R> (this Task<Result<R>> self) Source #
Pattern matching for exceptions. This is to aid expression based error handling.
Examples
tr.Match<string>()
  .With<SystemException>(e => "It's a system exception")
  .With<ArgumentNullException>(e => "Arg null")
  .Otherwise("Not handled")
class ExceptionMatchOptionalAsync <R> Source #
Pattern matching for exceptions. This is to aid expression based error handling.
Examples
ex.Match<string>()
  .With<SystemException>(e => "It's a system exception")
  .With<ArgumentNullException>(e => "Arg null")
  .Otherwise("Not handled")
Methods
method ExceptionMatchOptionalAsync<R> With <TException> (Func<TException, R> map) Source #
Matches a typed exception with a mapping function
Parameters
| type | TException | |
| param | map | Function to map the exception to a result value  | 
| returns | Matching context - you must use 'Otherwise()' to invoke  | |
method Task<Option<R>> OtherwiseReThrow () Source #
Invokes the match expression and provides a default value if nothing matches
Parameters
| returns | Result of the expression  | |
method Task<Option<R>> Otherwise (R otherwiseValue) Source #
Invokes the match expression and provides a default value if nothing matches
Parameters
| param | otherwiseValue | Default value  | 
| returns | Result of the expression  | |
class ExceptionOptionalAsyncExtensions Source #
Exception extensions
Methods
method LanguageExt.ExceptionMatchOptionalAsync<R> Match <R> (this Task<OptionalResult<R>> self) Source #
Pattern matching for exceptions. This is to aid expression based error handling.
Examples
tr.Match<string>()
  .With<SystemException>(e => "It's a system exception")
  .With<ArgumentNullException>(e => "Arg null")
  .Otherwise("Not handled")