try/catch blocks in agentinteraction