Bruno,
Thanks a lot for the answer and background info. I think I expressed myself
unclearly regarding errors in my original post. I'm not trying to delegate
error handling to a component. I hadn't really thought about it yet.
Instead, what I'm talking about is a custom error stack that I use. It's
possible for an error handler to push an error onto this stack, but it's
normally done by code. I don't use ASSERT, I use my own precondition checks
and push errors onto my custom stack. ON ERR CALL doesn' really have much
to do with it. Apart from anything else, the ErrorStack code makes my unit
testing a lot easier because one of the outcomes I can test for is the
state of the ErrorStack. How many errors are in there? What names do they
have? (I don't use error codes, they're meaningless. I use error names.)
I'm pretty into testing for exceptions, so my unit tests tend to have lots
of checks on things like out of bounds inputs, bad parameter lists,
malformed parameters, etc. Since the errors are stacked on the ErrorStack,
it's pretty easy to sort out if my tests failed or not. As always, unit
testing is both humbling ("humiliating" might be another word) and
reassuring. I'm pretty happy when I run the tests and turn up a change in
the error name(s) returned. Surprising how many little things slip through
when you recode.
**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ: http://lists.4d.com/faqnug.html
Archive: http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub: mailto:[email protected]
**********************************************************************