Even the best programmer can have a bad day
The original is long gone, the wayback machine has a copy
The actual article:
Lotus Script Blooper
Let this Lotus developer sit you down and spin you a yarn about how he filled the hard drive on his high-end server with more than a million agent logs in less than an hour. You may get a chuckle and learn something at the same time.
Being a good developer, all of my LotusScript has an Error handler following the pattern:
Sub MyProcedure
Dim ....
On Error Goto Err_MyProcedure
... my code
Exit_MyProcedure:
Exit Sub
Err_MyProcedure:
Call LogThisError("MyProcedure",Err,Erl,Error$) 'Generalized
'Errorhandler creating a document in a log database
Resume Exit_MyProcedure
End Sub
On one occasion, there was a check that needed to be performed, regardless of whether an error was happening or not, so I coded it like this:
Exit_MyProcedure:
if doc.hasEmbedded then ...
Unfortunately the doc
was not set at this time, so the execution jumped to the error label, created an entry in the database and then jumped back to the faulty code. Since we had quite a powerful server, I managed to create 1.2 million documents in the agent log in less than 30 minutes. Needless to say, the hard disk was full.
Lesson learned: If there is a need for code in the Exit_
Label, have an On Error Resume next
before code!
Posted by Stephan H Wissel on 24 January 2003 | Comments (0) | categories: IBM - Lotus