Reference

This library offers methods for minimalist error handling in Lotus Script. Each method is available twice, once for usage in normal subroutines and functions, and once for usage in class members, identified by the suffix c.

Summary of Library lserror.lss

Sub assert(condition As Integer, message As String)

Throws an error with the given message, if a given condition is false.

Sub assertc(object As Variant, condition As Integer, message As String)

Throws an error with the given message, if a given condition is false.

Sub notify()

Notifies an error depending on the environment.

Sub notifyc(object As Variant)

Notifies an error depending on the environment.

Sub rethrow()

Re-throws the current error with stack-trace added.

Sub rethrowc()

Re-throws the current error with stack-trace added.

Sub throw(id As Integer, message As String)

Throws an error with the given id and message.

Sub throwc(object As Variant, id As Integer, message As String)

Throws an error with the given id and message.

Sub assert(condition As Integer, message As String)

Throws an error with the given message, if the given condition is false. The id of the error is always 1000 indicating a user-defined error.

Throws:
error 1000 with the given message, if condition is false

Sub assertc(object As Variant, condition As Integer, message As String)

Throws an error with the given message, if the given condition is false. The id of the error is always 1000 indicating a user-defined error.

This method is designated to be solely used in classes and the object argument should always be set to the current class instance by passing Me.

Parameters:
object - class instance as context
Throws:
error 1000 with the given message, if condition is false

Sub notify()

Notifies an error depending on the environment: For scheduled agents and event triggered actions, the notification goes to the log database, for UI-actions a message box appears.

Sub notifyc(object As Variant)

Notifies an error depending on the environment: For scheduled agents and event triggered actions, the notification goes to the log database, for UI-actions a message box appears.

This method is designated to be solely used in classes and the object argument should always be set to the current class instance by passing Me.

Parameters:
object - class instance as context

Sub rethrow()

Re-throws the current error with stack-trace added. If no current error exists, the method returns without throwing an error.

This method is intend to only be called inside an error handler. Use the Error statement to throw a new error outside in normal program flow.

Throws:
Rethrows the current error if exists

Sub rethrowc(object As Variant)

Re-throws the current error with stack-trace added. If no current error exists, the method returns without throwing an error.

This method is intend to only be called inside an error handler. Use the Error statement to throw a new error outside in normal program flow.

This method is designated to be solely used in classes and the object argument should always be set to the current class instance by passing Me.

Throws:
Rethrows the current error if exists

Sub throw(id As Integer, message As String)

Throws an error with the given id and message. If a previous error exists, a nested error is generated.

This method is intend to only be called inside an error handler. Use the Error statement to throw a new error outside in normal program flow.

Parameters:
id - id of error as used in Erl
message - error message as used in Error$
Throws:
error with the given id and message

Sub throwc(object As Variant, id As Integer, message As String)

Throws an error with the given id and message and object as the context for the error. If a previous error exists, a nested error is generated.

This method is intend to only be called inside an error handler. Use the Error statement to throw a new error outside in normal program flow.

This method is designated to be solely used in classes and the object argument should always be set to the current class instance by passing Me.

Parameters:
object - class instance as context
id - id of error as used in Erl
message - error message as used in Error$
Throws:
always throws an error with the given id and message