|
On 28/07/2005, at 11:52 PM, rob@xxxxxxxxx wrote:
I understand the concept of a nice global default handler. I'm just not sure that I agree with it. There are numerous times that if my CL blows up on a particular line that I could deal with the situation externally, then reply with an R, or I, to the message and let it continue on. Then,add a project to my list to modify the code to handle the situation automatically in the future. Wouldn't I lose this capability with a global default handler?
I guess this could fall into the philosophical differences category. Although I understand what you mean about using the default handler to continue the program after you've fixed the external problem (wrong authorities, missing object, etc.) I don't agree with the philosophy. The default handler is useful during development but has no place in production code.
External dependencies should be set up correctly by the time code gets to production. Dependencies that can be handled by the code should be done either by checking for them before hand and creating them if necessary or by catching the exception and recovering at that point.
The global handler is to catch the unexpected. Conditions that can be anticipated and handled in the code should be done using command level exception monitors. And yes, specifying a global monitor for CPF0000 or CPF9999 will stop the default handler from giving the option to retry or ignore however using the default handler to continue production code is just a kludge and probably indicative of thoughtless programming.
Regards, Simon Coulter. -------------------------------------------------------------------- FlyByNight Software AS/400 Technical Specialists http://www.flybynight.com.au/ Phone: +61 3 9419 0175 Mobile: +61 0411 091 400 /"\ Fax: +61 3 9419 0175 \ / X ASCII Ribbon campaign against HTML E-Mail / \ --------------------------------------------------------------------
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.