- 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.
ex.Match<string>()
.With<SystemException>(e => "It's a system exception")
.With<ArgumentNullException>(e => "Arg null")
.Otherwise("Not handled")
method ExceptionMatch<R> With <TException> (Func<TException, R> map) Source #
Matches a typed exception with a mapping function
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
returns | Result of the expression |
method R Otherwise (R otherwiseValue) Source #
Invokes the match expression and provides a default value if nothing matches
param | otherwiseValue | Default value |
returns | Result of the expression |
class ExceptionExtensions Source #
Exception extensions
method LanguageExt.ExceptionMatch<R> Match <R> (this Exception self) Source #
Pattern matching for exceptions. This is to aid expression based error handling.
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.
ex.Match<string>()
.With<SystemException>(e => "It's a system exception")
.With<ArgumentNullException>(e => "Arg null")
.Otherwise("Not handled")
method ExceptionMatchAsync<R> With <TException> (Func<TException, R> map) Source #
Matches a typed exception with a mapping function
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
returns | Result of the expression |
method Task<R> Otherwise (R otherwiseValue) Source #
Invokes the match expression and provides a default value if nothing matches
param | otherwiseValue | Default value |
returns | Result of the expression |
class ExceptionAsyncExtensions Source #
Exception extensions
method LanguageExt.ExceptionMatchAsync<R> Match <R> (this Task<Result<R>> self) Source #
Pattern matching for exceptions. This is to aid expression based error handling.
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.
ex.Match<string>()
.With<SystemException>(e => "It's a system exception")
.With<ArgumentNullException>(e => "Arg null")
.Otherwise("Not handled")
method ExceptionMatchOptionalAsync<R> With <TException> (Func<TException, R> map) Source #
Matches a typed exception with a mapping function
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
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
param | otherwiseValue | Default value |
returns | Result of the expression |
class ExceptionOptionalAsyncExtensions Source #
Exception extensions
method LanguageExt.ExceptionMatchOptionalAsync<R> Match <R> (this Task<OptionalResult<R>> self) Source #
Pattern matching for exceptions. This is to aid expression based error handling.
tr.Match<string>()
.With<SystemException>(e => "It's a system exception")
.With<ArgumentNullException>(e => "Arg null")
.Otherwise("Not handled")