Object-Oriented LotusScript Development for Real This Time, Part 3 — Exception Handling

Michael Schnake, Senior Software Engineer, Foconis AG

Heinz Fink, Head of Development, Foconis AG


August, 2009


The Foconis Object Framework (FOF) gives developers a working implementation of LotusScript error handling. Instead of figuring out how to code error handling yourself, you can use the framework’s exception handling options. Learn how the FOF’s object-oriented exception handling compares with native LotusScript error handling, how it handles both native LotusScript errors and custom errors, and how to interpret the data it reports so you can find the errors in your runtime code with pinpoint accuracy.


In some ways, runtime is like the Wild West. Even if you release bug-free code, you have no way to guarantee that the code calling your code (or the data imported from a file or the value a user enters) is also error-free. For example, let’s say that your code performs a numerical division using parameters supplied by an end user at runtime. The user enters a divisor, zero, that is given as a parameter to your function. The result is a “division by zero” error. Or, you have a method that works only if it’s given an object, and at runtime it gets a LotusScript nothing (an empty object reference), which results in the infamous “Object variable not set” error so beloved by LotusScript developers. These error messages tell you little more than that an error occurred. They can’t help you trace the cause of the problem.
Of course, you can (and sometimes have to) use the debugger to step through your code. But you also have to be able to reproduce the error, which can be especially difficult if it occurs, for example, at a customer site that you can not access directly. At Foconis, we’ve discovered that simply having a detailed error message completely eliminates the need for time-consuming debugging sessions (or plain guesswork) in the majority of cases.
Using the Foconis Object Framework (FOF), which is a production-ready, free, open-source LotusScript library, you can get more helpful information when a runtime error occurs — information that will tell you exactly where the error occurred and why — and you can do it without writing a lot of code. We’ll show you how.
Note!
For an introduction to the FOF, read Part 1 of this article, published in THE VIEW online knowledgebase in February 2009. To learn how to work with the FOF and get the benefit of the major object-oriented programming (OOP) concepts and features it implements, see Part 2, published in July 2009.

Would you like to see the full version of this article?

If you are an electronic license holder to THE VIEW, please log in to view this article.

If you would like information about becoming an electronic license holder — and having 24/7 unrestricted access to all articles and content in THE VIEW Online Knowledgebase — click here to see the available subscription options.

Or call 1-781-751-8813 to speak directly with a subscription and licensing specialist about customized access for you and your team.