Manage Learn to apply best practices and optimize your operations.

Coding a stack trace into LotusScript libraries eases error handling

You may be familiar with Java's stack trace information. Did you know you can also code a stack trace into your LotusScript libraries and agents? Use this quick code in your Lotus Notes environment.

Once I became familiar with Java's stack trace information, I found that receiving the Lotus Notes error message: "Object Variable Not Set" no longer helped me properly trap and manage errors.

Related resources from SearchDomino.com:
LotusScript agent indexes Lotus Notes/Domino databases

LotusScript code pluralizes singular nouns automatically 

LotusScript button saves time searching large Lotus Notes databases

I've found a way to code a stack trace into LotusScript libraries and agents. The trick is that you must have an error trap in every sub, function or method to capture useful information. Then, the code will build the stack as each error trap is tripped.

Following is output from my example:

Error: method ExampleClass.setup() 
has not been implemented.
 at [Exampleclass.New( ): 11]
 at [getObject('abstract').Getexampleobject: 8]  
 at [ExampleAgent.Initialize( ): 13]

LotusScript to retrieve stack trace
(Click on code for enlarged view and script download.)

Do you have comments on this tip? Let us know.

This tip was submitted to the SearchDomino.com tip library by member Rodney Rear. Please let others know how useful it is via the rating scale below. Do you have a useful Lotus Notes/Domino technical tip or code snippet to share? Submit it to our monthly tip contest and you could win a prize.

Dig Deeper on LotusScript

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.

-ADS BY GOOGLE

SearchWindowsServer

Search400

  • iSeries tutorials

    Search400.com's tutorials provide in-depth information on the iSeries. Our iSeries tutorials address areas you need to know about...

  • V6R1 upgrade planning checklist

    When upgrading to V6R1, make sure your software will be supported, your programs will function and the correct PTFs have been ...

  • Connecting multiple iSeries systems through DDM

    Working with databases over multiple iSeries systems can be simple when remotely connecting logical partitions with distributed ...

SearchDataCenter

SearchContentManagement

Close