Bill Buchan4 commented on Oct 10, 2008

lsi_info(14) gets a stack trace

But be warned - under severe load conditions (lots of http agents or two or more long-running agents at the same time - using LSI_Info sometimes crashes the server..

---* Bill

Benoit 2 TARADE commented on Sep 23, 2008

test for handle resume

You can check if need to resume the error handling by using getthreadinfo

if Getthreadinfo(LSI_THREAD_PROC) = Getthreadinfo(LSI_THREAD_CALLPROC) then

resume handleExit


exit function/sub

end if

Thomas Bahn commented on Feb 25, 2008

Handling errors in LotusScript


"It provides minimal coding to implement error handling into any application"

No, unfortunately not. You can only add error LOGGING. If you want to add an application specific error HANDLING, you have to add it yourself.


Mika Heinonen commented on Feb 24, 2008

Handling errors in LotusScript

I'm using OpenLog.nsf ( { Link } ) from It provides minimal coding to implement error handling into any application (just 1 line of code: LogError() ). It can be used for LotusScript, Java, JavaScript, and all errors are stored into a single OpenLog.nsf database, which can be replicated between all servers. Then you have one place where you see all errors of all servers.

Richard Schwartz commented on Feb 23, 2008

Handling errors in LotusScript

Why doesn't this article show up in the "App dev" category?

Because you can only add one category per article, that's why!

The wiki design needs to allow multiple categories. Or, to use the more up to date buzzword, "tags".

Jérôme Deniau commented on Feb 22, 2008

Handling errors in LotusScript

I do think the best way is to use LSI

This was first published by Rocky Oliver before he left IBM:

Name Description Type

Err Numeric error code integer

Error Error text string

GetThreadInfo(LSI_THREAD_LINE) Current line number variant

GetThreadInfo(LSI_THREAD_PROC) Current procedure variant

GetThreadInfo(LSI_THREAD_MODULE) Current module variant*

GetThreadInfo(LSI_THREAD_VERSION) Lotusscript version variant

GetThreadInfo(LSI_THREAD_LANGUAGE) Language setting variant

GetThreadInfo(LSI_THREAD_COUNTRY) Country/Region setting variant

GetThreadInfo(LSI_THREAD_TICKS) Current clock ticks variant

GetThreadInfo(LSI_THREAD_TICKS_PER_SEC) Clock ticks per second variant

GetThreadInfo(LSI_THREAD_PROCESS_ID) Current process ID variant

GetThreadInfo(LSI_THREAD_TASK_ID) Current task ID variant

GetThreadInfo(LSI_THREAD_CALLPROC) Calling procedure variant

GetThreadInfo(LSI_THREAD_CALLMODULE) Calling module variant

Lsi_info(1) Current line number string

Lsi_info(2) Current procedure string

Lsi_info(3) Current module string

Lsi_info(6) Lotusscript version string

Lsi_info(9) Language setting string

Lsi_info(12) Calling procedure string

Lsi_info(50) LS memory allocated string

Lsi_info(51) OS memory allocated string

Lsi_info(52) LS blocks used string

you normally have to use %include "lsconst.lss" to get every constants work.

Thomas Bahn commented on Feb 21, 2008

Handling errors in LotusScript

We use a self-made framework with some advanced error handling capabilities.

We have a set of ErrorHandler classes like LogErrorHandler (writes error to Log document), MailErrorHandler (mails error notification), MessageboxErrorHandler, UserDialogErrorHandler, IgnoreErrorHandler (just ignores a certain error) etc. We can even define new, application specific ErrorHandler subclasses like BackupNotFoundErrorHandler (when restoring a backup document, but the backup document can't be found).

ErrorHandlers can be registered at a central ErrorHandlerRegistry. This a is priority queue that is each ErrorHandler has a priority and those with the highest priority are the first in the queue.

When an error occurs, a central HandleError sub is called. It iterates through the priority queue. It asks each registered ErrorHandler in turn, if it "feels responsible" for the error, which has occurred. If so, it gets a chance to handle the error. If it returns True this means, it has handled the error sucessfully and the execution continues after the error producing line (Resume Next). If it returns False, HandleError continues with the next registered ErrorHandler.

If no ErrorHandler handles the error sucessfully, we normally End the execution of the LotusScript code at that point.

Thomas Bahn commented on Feb 21, 2008

Handling errors in LotusScript

Instead of coding your error "handling" (it's only notifying the user in this case), use a framework or tool like Julian Robichaux's OpenLog. This way, you can notify the user AND log the error to a database with a lot of context information for further investigation.

{ Link }

Thomas Bahn commented on Feb 21, 2008

Handling errors in LotusScript

I often see some

"Exit Sub"


"Exit Function"

after the user has been notified. I would propose using


instead. The error hasn't been handled, therefore the "system" is in an undefined state. Just continuing after the call to the current sub seems a little bit risky - to say the least. ;-)