From: Brandon P. <bp...@gm...> - 2010-05-27 14:43:49
|
Ok, I guess I should have mentioned that I also want to handle: try: something that raises my exception except MyException, e: .... as well as catching RuntimeError Thanks, -Brandon On Wed, May 26, 2010 at 1:56 PM, Jeff Emanuel <jem...@fr...> wrote: > > > MyExceptionThrower.java: > public class MyExceptionThrower { > public static void toss() { > throw org.python.core.Py.RuntimeError("my exception"); > } > } > > import MyExceptionThrower > try: > MyExceptionThrower.toss() > except RuntimeError, e: > print e > > > > Brandon Pedersen wrote: >> >> Hey, >> >> If I want to create an exception type in Java that is available in a >> jython script and is a subclass of RuntimeError, how would I do that? >> >> so, >> >> try: >> something that raises my exception type >> except RuntimeError, e: >> .... >> >> would work >> >> Thanks, >> >> -Brandon >> >> >> ------------------------------------------------------------------------------ >> >> _______________________________________________ >> Jython-users mailing list >> Jyt...@li... >> https://lists.sourceforge.net/lists/listinfo/jython-users > |