|
From: Richard G. <rg...@in...> - 2001-03-14 21:24:50
|
Hi,
If I define a Java 2 exceptions classes with one being a subclass of the
other:
public class BaseException extends Exception
{ ... }
public class DerivedException extends BaseException
{ ... }
And if the DerivedException is raised in a Java program, I can catch it
in Jython as a DerivedException but *not* as a BaseException, i.e the
following code:
try:
# call the java prog that raises a DerivedException
except DerivedException, e:
print "Got a DerivedException :", e
... will display "Got a DerivedException : ...." (which is OK)
whereas the code:
try:
# call the java prog that raises a DerivedException
except BaseException, e:
print "Got a BaseException :", e
else:
import sys
exc_type, exc_value, exc_traceback = sys.exc_info()
print 'uncaught exception', exc_type, exc_value, exc_traceback
...will display "uncaught exception ..." instead of "Got a
BaseException..."
This looks abnormal to me!
Am I missing something or is it a bug ? Thanks for any clue.
Richard
|