Email:   
Home
In This Issue
Email a Friend
EasyPrint
News details Click here for the RSS feed's XML code. This is not a browser URL.
Articles-only Click here for the RSS feed's XML code. This is not a browser URL.
PROGRAMMING POWER
Getting a handle on LotusScript error handling
By Tony Patton

One part of Domino development that's often overlooked is error handling. While errors may be caught, many developers may not understand the nature of the error. For example, a bit of LotusScript code may return the error 4001, but where's a description of this error?

The answer lies in a few text files in your base Notes directory (c:\notes). The following list contains the files included with a standard install.

  • lsconst.lss is a list of constants (like the ones used with MessageBox).

  • lsxuierr.lss lists user interface errors.

  • lsxbeerr.lss is a list of more errors.

  • lserr.lss is a compilation of basic LotusScript errors.

You can open these files in your favorite editor and search for the error number to get a better idea of the problem. Now, the additional information found in these files isn't exactly user-friendly, but it does provide more clues.

For example, error 4001 includes the following information: lsERR_SYS_OUT_OF_MEMORY. It looks like a memory problem that may be caused by the code--check the object cleanup or data structure sizes.

In LotusScript, you can utilize these numbers with the On Error statement. The following line tells the code to jump to the designated code label when error 4001 is encountered:

On Error 4001 Goto Handle4001Error

The Java try/catch block may be used as well. By using the error code files above, tracking down the cause of your errors may just go a little smoother and your life a little easier.

DominoPower Contributing Editor Tony Patton is a Domino enthusiast with plenty of experience in Domino, Java, XML, and any other hot buzzword. He has written two books (Practical LotusScript and Domino Development With Java) and is a long-suffering Philadelphia sports fan. Drop him a line at aspatton@bellsouth.net.


ZATZ Home  ·  News  ·  Back Issues  ·  Credits/Trademarks ·  Link To Us
-- Advertisement --

2-Minute Tutorials
How do I...

  • integrate MS Office or OpenOffice with Notes?
  • create cross-tab reports and charts?
  • print serial letters and mailing labels?
  • create PDFs in Lotus Notes?


Check out the 2-minute tutorials here.
-- Advertisement --

Get in the Spotlight! Teamstudio Spotlight Awards 2009
For the second year, Teamstudio is holding the Teamstudio Spotlight Awards Contest to recognize developers of the Notes community for their most remarkable Notes applications! Winners will be announced at Lotusphere 2009 January and featured in DominoPower in the month of February. Prizes to include:

1st Prize: Your choice of one configured software product with installation at one site, Teamstudio's complete suite of tools for one user and an iPod Touch.
2nd Prize: Teamstudio's complete suite of tools.
3rd Prize: One tool of your choice.

For more information on how to enter, click here!

Copyright © 1998-2008, ZATZ Publishing. All rights reserved worldwide.
Editor's Login