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:

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.