Exception Handling

Reminder

Principles

Example: Curo

with transaction.atomic():
    task = Task.objects.create(...) # or update some properties then task.save()
    submit_entity_unhandled()

Example: Third Party API Call

# if response data is needed
foo_id = third party POST or PATCH
raise_for_status()
save `foo_id` to local DB