How to handle error and retry/recovery