I am calling a lotusscript agent from the PostSave event of an xpage (taken from the IBM Wiki Template). I would like to add some error trapping so if something happens (I had cases of "attachments missing... run compact to fix this" error), the application would at least warn the user that something went wrong.
Do I need to put the error trapping code in the agent? Does it belong in the PostSave event of the xpages?
The agent is called that way:
<xp:this.data>
<xp:dominoDocument var="pageDocument" formName="fPage"
action="openDocument" ignoreRequestParams="false"
computeWithForm="onsave">
<xp:this.postSaveDocument><![CDATA[#{javascript:var agent = database.getAgent("XPSavePage");
agent.runOnServer(pageDocument.getDocument().getNoteID());}]]>
</xp:this.postSaveDocument>
</xp:dominoDocument>
<xp:this.data>
The agent is working great, but on some documents, we do have a missing attachments error, due to some conversion errors and other cases (persitence related, most probably). But I have no clue on how to trap if an error occured in the Lotus Script agent...