MethodHandles.CatchException(MethodHandle, Class, MethodHandle) Method

Definition

Makes a method handle which adapts a target method handle, by running it inside an exception handler.

[Android.Runtime.Register("catchException", "(Ljava/lang/invoke/MethodHandle;Ljava/lang/Class;Ljava/lang/invoke/MethodHandle;)Ljava/lang/invoke/MethodHandle;", "", ApiSince=26)]
public static Java.Lang.Invoke.MethodHandle? CatchException (Java.Lang.Invoke.MethodHandle? target, Java.Lang.Class? exType, Java.Lang.Invoke.MethodHandle? handler);
[<Android.Runtime.Register("catchException", "(Ljava/lang/invoke/MethodHandle;Ljava/lang/Class;Ljava/lang/invoke/MethodHandle;)Ljava/lang/invoke/MethodHandle;", "", ApiSince=26)>]
static member CatchException : Java.Lang.Invoke.MethodHandle * Java.Lang.Class * Java.Lang.Invoke.MethodHandle -> Java.Lang.Invoke.MethodHandle

Parameters

target
MethodHandle

method handle to call

exType
Class

the type of exception which the handler will catch

handler
MethodHandle

method handle to call if a matching exception is thrown

Returns

MethodHandle

method handle which incorporates the specified try/catch logic

Attributes

Remarks

Java documentation for java.lang.invoke.MethodHandles.catchException(java.lang.invoke.MethodHandle, java.lang.Class<? extends java.lang.Throwable>, java.lang.invoke.MethodHandle).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to