Minimal error handling

This minimal error handling suite does very little, but it’s also very useful: any error is caught, context info is appended and the error is thrown again. To simplify and clarify all the code, the suite must be included in a LotusScript file at the very top of each Sub or Function.

Usage

Sub Initialize
%INCLUDE "error_handling"

    Dim args As Variant

    args = "RAPUTA"

    Call Outer( args )

End Sub

Call this file error_handling.lss and store it in the notes folder

'catch any error & throws it again, decorated
	On Error Goto HandleError
	Goto EnterProc  
HandleError:     
	Error Err, Getthreadinfo( 1 ) & " : " & Erl & Chr$( 10 ) & Error$ 
EnterProc:

Tolerance to loss of connectivity when auto-refreshing a page

Refreshing content could be loaded in an invisible container and then copied to the visible one if it’s valid. The validity check could be in the content itself: a function call at the end of the body will do.

Prepare two containers for your content: VisibleContainer, and HiddenContainer. Define two global script functions: refreshVisible(), and refreshHidden().

refreshHidden()

  1. download fresh content to the HiddenContainer
  2. reset a timer for calling refreshHidden() after x seconds

refreshVisible()

  1. if not called from HiddenContainer then exit
  2. copy fresh content from HiddenContaner to VisibleContainer

Finally, call refreshHidden() from the onLoad event of VisibleContainer, and make a call to refreshVisible() from the very end of the content loaded in HiddenContainer.

If there is a loss of connectivity, then there is no call to refreshVisible(), and no error is shown. Also, the timer will continue to run and it will call refreshHidden() upon expiration.

(revised text from my own comment 12628152 at Experts-Exchange)