Skip to main content

Try-Catch with DB Transactions

Premium
3 min read

The Full Lesson is Only for Premium Members

Want to access all of our courses? (36 h 00 min)

You also get:

61 courses
Premium tutorials
Access to repositories
Private Discord
Get Premium for $129/year or $29/month

Already a member? Login here

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