Skip to content

Instantly share code, notes, and snippets.

@mcsee
Last active August 22, 2023 03:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mcsee/a4fc40e63f2506bf02144c9f71f164a3 to your computer and use it in GitHub Desktop.
Save mcsee/a4fc40e63f2506bf02144c9f71f164a3 to your computer and use it in GitHub Desktop.
try {
transaction.commit();
} catch (transactionError) {
this.withTransactionErrorDo(
transationError, transaction);
}
// transaction error policy is not defined in this function
// so you don't have repeated code and code is more readable
// It is up to the transaction and the error to decide what to do
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment