If prediction impossible continue

Hello, I trained an LSTM model. I wish I could continue to predict even after the user is asking for an impossible prediction for the model. Can you tell me how to do it? (If prediction possible give the prediction, if prediction impossible continue). Thank you in advance.

Sorry my question was stupid, I found the answer (try / except)…