Xpages: error trapping in LotusScript Agent called from SSJS -


i calling lotusscript agent postsave event of xpage (taken ibm wiki template). add error trapping if happens (i had cases of "attachments missing... run compact fix this" error), application @ least warn user went wrong.

do need put error trapping code in agent? belong in postsave event of xpages?

the agent called 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 working great, on documents, have missing attachments error, due conversion errors , other cases (persitence related, probably). have no clue on how trap if error occured in lotus script agent...

the agent has 0 visibility calling environment, short of documentcontext. need write status document , check value in xpage. if want cautious, set status 'agentfailed' , let agent update either 'success' or more specific error. way trap errors agent couldn't write document.

while on it: improve application's response time taking out start of agent runtime - write code in bean. sessionassigner gives elevated rights might need


Comments

Popular posts from this blog

javascript - AngularJS custom datepicker directive -

javascript - jQuery date picker - Disable dates after the selection from the first date picker -