When you create some methods or functions, typical error handling message would be
something link this
Print "(functionName): Error (" & Cstr(Err) & ") Line: " & Cstr(Erl) & " - " & Error$
Instead of coding the sub or function name, using Lsi_info, you can create a error handling message like below
Print Lsi_info(2) & " called by " & Lsi_info(12) & ": Error (" & Cstr(Err) & ") Line: " & Cstr(Erl) & " - " & Error$
The variable lsi_info is an array of strings.
- lsi_info(2) is the current module - sub or function name.
- lsi_info(12) is the module that called this sub or function. If lsi_info(2) is INITIALIZE, then so is lsi_info(12)
Show-n-Tell Thursday
2 comments:
Another great thing to try for LotusScript error handling is the OpenLog application on the OpenNTF site. It uses lsi_info and many other tricks to easily access error logging information.
All you have to do is copy the script library to your database, include it in your LotusScript code, and type "LogError" in all your error handling blocks.
@Julian. Yes, OpenLog is a great tool to use. Thanks for the OpenLog contribution to LN community.
Post a Comment