Skip to content

Instantly share code, notes, and snippets.

@bruceyue
Created September 21, 2012 03:02
Show Gist options
  • Save bruceyue/3759516 to your computer and use it in GitHub Desktop.
Save bruceyue/3759516 to your computer and use it in GitHub Desktop.
try catch
Savepoint sp = Database.setSavepoint();
try
{
}
catch(Exception ex)
{
ApexPages.addMessages(ex);
Database.rollback(sp);
return null;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment