I improved my error handling for the openAI API in this PR.
The problem is that the API is sometimes overloaded with requests of users. In those cases the API won't return any response when trying to fetch the data. This means that you can't catch an error from a bad response as there is no response at all. With no response my fetch function would pretty much run infinitely.
I now implemented a timeout of 28 seconds. So when there is no response after 28 seconds, an error is thrown and an info text is being displayed.
I improved my error handling for the openAI API in this PR.
The problem is that the API is sometimes overloaded with requests of users. In those cases the API won't return any response when trying to fetch the data. This means that you can't catch an error from a bad response as there is no response at all. With no response my fetch function would pretty much run infinitely.
I now implemented a timeout of 28 seconds. So when there is no response after 28 seconds, an error is thrown and an info text is being displayed.