Shiny app stops due to error. How to manage such errors

I have a shiny app where I call a function from a different package. So when I call this function if the values are not in a certain range that function throws an error and the app stops.
Eg function :

data <- callFunction(cost,input1,input2)

So when the callFunction throws an error it stops the app. I dont want the app to stop and just throw a message on the app saying your inputs are incorrect please modify it. How can I do this in a shiny app.Thank you.

If you know what input values are not correct, validate them before passing further.
You can use req(), validate-need or simple if-else statements.
It would be easier if you give us some example which is not working for you as expected.

1 Like

This topic was automatically closed 7 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.