Two things here:
1. Adding the transaction code (should have been there anyway, really)
2. Adding the `try...catch`.  In fact, this can be made generic to any exception...