Can anyone advice me for good error handlers in lotus script
Subject: Good error handlers
Simran,
Not too sure exactly what your question is looking for. “Good error handlers” is a bit vague"!
Look in the Designer Help for “On Error” which will give you some guidance on how to set them up
Mike
Subject: RE: Good error handlers
Look on www.openntf.org for OpenLog database. It will log Lotusscript and Java script
JYR
Subject: RE: Good error handlers
And JavaScript.
Subject: RE: Good error handlers
Merely logging, though, is not necessarily “good error handling”. There are, after all, recoverable errors and errors that SHOULD be expected. Some of these errors can be trapped inline (checking data types for field values where the widget says “date/time” or “number” but the field can be empty, f’rinstance). Some can be trapped by error number with a simple resume next action (like 4414 – lsERR_NOTES_ADDENTRY_DUP – which WILL happen if you’re walking a categorized view and adding view entries to a collection if the category field is multivalue, or when using “show multiple values as separate entries”).
Sometimes we forget that good programming is hard work.
Subject: RE: Good error handlers
Good post Stan
If it wasn’t hard work, everyone would be doing it! ![]()
Subject: RE: Good error handlers
Hi all,
Formerly, neither logging nor ‘on error’ are error ‘handlers’. The only one is the code.
The first thing to do is to verify the data constitency (or to have an on error logging ‘the coder is a fool’).
The second one is to use hierarchical procedural programing, AND, hierarchical on error statements.
Then, third, to log any non-handled error.
![]()
Subject: RE: Good error handlers
WHAT???
Subject: What what ?
Subject: RE: What what ?
Very little of what you posted made any real sense. “On Error” is a fundamental part of proper error handling in LS – one can throw all the guard statements one want into a routine, and there will still be the possibility of run-time errors. Some are recoverable, some are not.
“Procedural” programming has nothing to do with it, really – whether the code is inlined within a sub, called as a sub/function, or invoked from a method call to a class, one still needs to consider what happens when errors are encountered. Can the error be safely ignored (as is always the case with 4414)? Can the desired machine state be reached by another method (by, say, using a default value and retrying)? Does the code need to be halted immediately? Coding style (procedural vs. OOP, “hierarchical” vs “flat”) won’t insulate you from any of it.
Subject: RE: What what ?
OK Stan
Maybe my lack of english vocabulary could be a reason for my mis-explaining of what I wanted to write.
I meant that the ‘on error’ statement ain’t an error handler at all. It’s only a ‘what do I do whenever it crashes’ statement.
Handling, e.g. in OOO btw, works a very different way.
When I was talking about procedural programing, it was meant as the starting of the OO one.
The architecture of LS seemed to me to be an object one. Saying that any error not catched at any level, goes to the superior one.
With this optic, first of all, using “if (not blabla is Nothing) then” is the better start point.
But it ain’t an “error handler”, it is a consistency check.
In my opinion, a “good error handler”, as he asked, should be at an upper level.
It may come with things like log4j, or openlog, but, it surely have to come with a class that really HANDLES the possible errors, log them, and tries to bypass in any possible manner.
Maybe am I wrong about this philosophy, but, according to what I know about LS, nothing does these things right now.
Last, Stan, I’m very HAPPY to hear you again, I missed you.
I really hope that at least the less is OK for you.
Finally, please, correct me if I’m wrong.
ian
PS: sorry for my english, I just come back from a pub… ![]()
Subject: -
Subject: Good error handlers
Subject: RE: Good error handlers
Hi,
“Good error handling starts by treating [possible] errors as part of your process.”
Obvious.
“This will undo all the updates made to a document during the script processing.”
Wrong.
“I will also leave the actual saving or deleting of documents to the very end of the script.”
Right
“A uniform method of capturing all errors, such as OpenLog, is essential for resolving issues.”
Very Right
“Create proper messaging for informing the user of errors and of what steps to take.Create proper messaging for informing the user of errors and of what steps to take.”
Right, but it ain’t an error handling, it’s only good-sense. It is generally done by validation formulas.
Btw, what meaned your post concerning the “pub” ? How should I understand it ?
Regards, S’pozdravem
ian
Subject: RE: Good error handlers
Subject: Sarcasms…
First all on, excuse me for my english, it is very poor.
Then, keep me away from your sarcasms (never coded after a beer ? poor you)
You say :
“If the OnError is fired, then the rollback process is executed.”
Where did you see that any rollback exists in Domino ?!!??
The document have been saved, or not => no rollback availabale.
regards.
Subject: RE: Sarcasms…