Skip to content

Instantly share code, notes, and snippets.

@JacekDubikowski
Created December 2, 2022 18:26
Show Gist options
  • Select an option

  • Save JacekDubikowski/8b691faf3e0aba2e04d03211823794ff to your computer and use it in GitHub Desktop.

Select an option

Save JacekDubikowski/8b691faf3e0aba2e04d03211823794ff to your computer and use it in GitHub Desktop.
Try block
class TransactionalInterceptedWriter {
private static CodeBlock tryClause(CodeBlock transactionalMethodCall, CodeBlock catchClause) {
return CodeBlock.builder()
.beginControlFlow("try")
.add(transactionalMethodCall)
.endControlFlow()
.add(catchClause)
.build();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment