Aman Garg
Apr 5, 2023

--

It's often a good idea to wrap the database access into two buckets -> mutations and queries. For each, build decorators that handle guaranteed rollback / commit etc.

The main function (in business application layer) should just return well defined custom errors such as "ErrCancelNotApplicable". This error struct should have properties like "isRetriable" which defaults to false and so on. The idea is that framework should do most of the heavy lifting else you risk another "CancelV2" API making the same mistake.

Also, go easy on the memes :)

--

--