Legend

Class
Struct
Enum
Interface
Delegate
Constructor
Method
Property
Event
Field

Static method: TResult OnException<TException, TResult>(Func<TResult>, Func<TException, TResult>)

  • Declared in: RT.Util.Ut

Declaration

public static TResult OnException<TException, TResult>(
    Func<TResult> func,
    Func<TException, TResult> onException
)

Summary

Evaluates the specified code and returns its result. If the code throws an exception of the specified type, runs onException instead.

Generic type parameters

TException
  • Must derive from: System.Exception.
This type parameter is not documented.
TResultThis type parameter is not documented.

Parameters

Func<TResult>func The code to be executed.
Func<TException, TResult>onException The code to be executed in case of failure.