Testing a query before searching?

Hello,I have the following problem:

I have a daily lotusscript agent that do a search for several users and send the results by email.

For the query I authorize the users to have a keyword field where they can enter what they want. The problem is that if the keyword is not correct when interpreted in the query by the agent. My agent stop. I would like to receive an email when the query is not interpretable and that the agent continues to run.

Is it possible?

Any help is appreciate.

Regards

Subject: Testing a query before searching?

Please provide an example of valid formula and invalid formula.