I have a normal C# thread that calls a third party API (which internally makes a Network API call), recently I observed that sometimes the third party API throws WebTimeOut exception. My thread which calls the API is not running continuously, it is called only when needed (I cannot and do not wish to call the third party API from Main Thread).
This thread using that API is squaring-off an order and I must retry even if the Third Party API failed once/twice. How do I ensure that even if the thread had an exception (Like when calling that Third Party API which is throwing WebTimeOut Exception), it is retrying or restarting itself ?