2 ms·
You must for transactions (like, financial transitions). Let's say you're making a plane booking service (kiwi.com clone). You charge the customer, then book
by paulddraper 3y ago
You must for transactions (like, financial transitions).
Let's say you're making a plane booking service (kiwi.com clone).
You charge the customer, then book the flight. But if booking the flight fails, you must refund the customer.
- mrkeen 3y agoI'm not saying it's not necessary; I'm saying it's not sufficient. try { pay(); } catch { try { refund(); } catch { // "must refund the customer" implies we can't reach here } }