How to handle this Error?

Better to use state machine in such requirements :slight_smile:

If you will get error in any one of state then you can change its state to the initial state.

Regards…!!
Aksh