Skip to main content

"Black Friday" Discount! Only until December 1st: 50% off all membership plans!

Read more here

Try-Catch with DB Transactions

Premium
3 min read
Luís Pedro Arede avatar

A question about using try-catch blocks:

What's the best approach, in your opinion? Wrap the DB::beginTransaction() inside try {} or put it outside the try{} block, just like the example?

Modestas avatar

It's better to have it outside in my opinion, but to be fair - it doesn't matter