On Jun 27, 2006, at 9:59 AM, Michael Hawksworth wrote:

I don't agree, if you catch error within your code you can code to allow one exit.

*IF* you catch it in the same block as it was raised. But most designs don't limit themselves to something like that. For example, Dabo's dForm.requery() method looks like:

try:
        self.PrimaryBizobj.requery()
except dException.NoRecordsException:
        self.StatusBarText = "No records returned"
except dException.ConnectionClosedException:
        dabo.ui.stop("Connection to the database was lost")
...

The form doesn't care where those exceptions were raised; in fact, they are raised several levels down in the code that actually executes the database query. But the beauty of raising exceptions like this is that they are not limited to returning only one level up the call stack; they percolate up to the appropriate handler, where they can be processed (and re-raised if needed). You don't bracket all your code at every level; only the places where the exception handling occurs needs to have code present

-- Ed Leafe
-- http://leafe.com
-- http://dabodev.com





_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to