Well… if operating in Terraform’s default mode, the absence of the object should have already been picked up during the Read() phase.
This case would generally come up when the user is using -refresh=false - which users typically do with larger configurations that just take too long to refresh every time.
#1 seems OK behaviour to me … assuming the Read() method does properly handle infrastructure disappearing, so that users have a way to recover by turning refresh back on.
@hQnVyLRx can you expand a little on the scenario(s) that result in "got deleted before Update() "? Are your referring to infrastructure being manually deleted outside of Terraform?
From Terraform’s perspective, applying a plan should never do anything which was not recorded in the plan. If the plan was to update a resource, and that resource no longer exists, then the provider should return an error because the given plan cannot be applied.
For most resources, you could not create a new instance on demand and end up with all the same computed attributes, so the resulting applied state would not be valid (In the rare case that a resource could be transparently created with the exact same state, then I supposed that is an option, but it’s not how most resources work).
You do not need to remove state along with an error, terraform will assume this is a mistake and keep the last state just in case. The resource state will be updated and dealt with on the next read and plan cycle.