javapoet-dsl / com.mostlycertain.javapoetdsl / CodeBuilder / TryFlow / catchDecl

catchDecl

fun catchDecl(types: List<TypeName>, variableName: String, block: CodeFunc): TryFlow

Render a catch block.

The exception variable is declared final.

Parameters

types - Exception types to catch. More than one type will render a multi-catch.

variableName - Exception variable name.

fun catchDecl(type: TypeName, variableName: String, block: CodeFunc): TryFlow
fun catchDecl(type: KClass<out Throwable>, variableName: String, block: CodeFunc): TryFlow

Render a catch block.

The exception variable is declared final.

Parameters

type - Exception type to catch.

variableName - Exception variable name.