Skip to main content
This forum is closed to new posts and responses. New discussions are now taking place in the IBM Developer Answers forum.
Information Mgmt
New to Lotus
How to buy
Live demos
Technical library
Forums & community
Java™ technology
Open source
SOA and Web services
Web development
My developerWorks
About dW
Submit content

developerWorks  >  Lotus  >  Forums & community  >  IBM Lotus Notes/Domino 8.5 Forum (includes Lotus Notes Traveler)

IBM Lotus Notes/Domino 8.5 Forum (includes Lotus Notes Traveler)

Previous Next

Error trap

You might want to add error trapping in the code. Here is an example

Sub Initialize
'The following line says to jump to the label called ErrorHandler if there is an error.
On Error Goto ErrorHandler

Dim s As New NotesSession
Dim thisAgent As NotesAgent

'This is used to obtain the name of the agent currently running.
Set thisAgent = s.CurrentAgent

'Your code goes here

'The Done label is there so you can reference it in your ErrorHandler.
'The Exit Sub jumps past the ErrorHanlder if the code above successfully completes.
Exit Sub
'The Select statement enables you to handle test for different errors. For example,
'when Err is 53, it indicates "File not found." With some errors, you might choose to
'skip to the next line of code, rather than exiting the entire subroutine.
'For more details, open the "On Error statement" in the Designer help database Index.
Select Case Err
Case Else
'The next line will document an error, and will include the error number, the agent name,
'the line throwing the error, and the error description.
'The agent name is helpful if this is a web triggered or scheduled agent.
Msgbox "Error " & Cstr(Err) & " in " & thisAgent.Name & " on line " & Cstr(Erl) & ": " & Error
Resume Done
End Select
End Sub

Feedback response number WEBBAU74BU created by Barry Shapiro on 12/18/2017

Persnickety LotusScript Error (Stacy Elmwood 18.Dec.17)
. . no problem. (Mike Woolsey 18.Dec.17)
. . You want to test if item is empty (Carl Tyler 18.Dec.17)
. . . . Error trap (Barry Shapiro 18.Dec.17)
. . . . Empty?? (Stacy Elmwood 20.Dec.17)
. . . . . . Inspect using debugger (Martha Geppert 20.Dec.17)
. . . . . . . . It's there alright, but not seen? (Stacy Elmwood 21.Dec.17)
. . . . . . . . . . I wonder if it being summary protec... (Carl Tyler 21.Dec.17)
. . . . . . . . . . . . Access Level = Manager (Stacy Elmwood 21.Dec.17)
. . . . . . . . . . Look further at the field / item (Martha Geppert 22.Dec.17)
. . . . . . . . . . . . Check all documents (Alex Elliott 1.Feb.18)


Search this forum

Member Tools

RSS Feeds

 RSS feedsRSS
All forum posts RSS
All main topics RSS
More Lotus RSS feeds


Forum use and etiquette
Native Notes Access
Web site Feedback

Lotus Support

 Lotus Support
IBM Support Portal - Lotus software
Lotus Support documents
Lotus support by product
Lotus support downloads
Lotus support RSS feeds


IBM Composite Applications
IBM Mashup Center
IBM Connections
IBM Connections Cloud Developers
IBM Docs
IBM Forms
IBM Mobile Connect
IBM Sametime
IBM SmartCloud for Social Business
IBM Web Experience Factory
Lotus Domino
Lotus Domino Designer
Lotus Expeditor
Lotus Foundations
Lotus iNotes
Lotus Instructor Community Courseware
Lotus Notes
Lotus Notes & Domino Application Development
Lotus Notes Traveler
Lotus Protector
Lotus Quickr
Lotus Symphony
IBM Web Content Manager
WebSphere Portal

Lotus Forums

 Lotus Forums
Notes/Domino 9.0
Notes/Domino 8.5 + Traveler
Notes/Domino XPages development forum
Notes/Domino 8
Notes/Domino 6 and 7
IBM Connections
IBM Mobile Connect
IBM Sametime
IBM SmartCloud Notes
Lotus Enterprise Integration
Lotus Protector
Lotus Quickr
Lotus SmartSuite