Restart shinyapp when an API error occurs

I am running a shinyapp for a museum instalation, and the app calls an external API (in this case openAI API key). The app has to be open all the time, but sometimes, the API can generate a bad request, or even crashes the app due to it is solicitating a non-safety question. Is there any way to prevent or solve that, for example, by restarting the app when a crash occurs?

Thanks in advance!

What about putting the external API call inside tryCatch with some appropriate mechanism for dealing with an error (warning the user, counting to ten and then trying again, ...)? That would hopefully prevent the Shiny app from crashing. As far as how to handle an API glitch, that would depend on the workings of the app.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.