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? (30 h 41 min)

You also get:

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

Already a member? Login here

Comments & Discussion

LP
Luís Pedro Arede ✓ Link copied!

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?

M
Modestas ✓ Link copied!

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

We'd Love Your Feedback

Tell us what you like or what we can improve

Feel free to share anything you like or dislike about this page or the platform in general.