[Tutor] Re: catching any exception?

BELSEY, Dylan dylan.belsey@baesystems.com
Mon Nov 18 17:03:00 2002


	Is it possible to import you DCOracle module where the exceptions
are defined and then perform the following:

	try:
		# Whatever
	except DCOracle.exception, errmsg:
		# handler ???

	As you have said below, if DCOracle defines exceptions, why not try
and use them. This is just an idea as I have not seen the definition of the
DCOracle exceptions.


> -----Original Message-----
> From: Lance E Sloan [mailto:lsloan@umich.edu]
> Sent: Saturday, 16 November 2002 07:00

> But I've noticed that the code only works for any of the "standard" 
> exceptions.  If I define my own exception, which is what 
> DCOracle does, and 
> raise that, it's not caught:
> 
> How can I catch all exceptions, 
> including the ones that DCOracle defines?
> 
> For that matter, how can I create an exception that's just like a 
> "standard" exception?  I think that's part of the problem.  
> The string type 
> of exception that DCOracle defines doesn't have Exception as a parent.