Re: catching a from CORBA.UserException inherited exception

Discussion in 'Python' started by Peter Otten, Aug 22, 2003.

  1. Peter Otten

    Peter Otten Guest

    Birgit Rahm wrote:

    > 3. then I want to invoke a method within a try - except statement, where
    > the except statement has to catch an exception defined in the file created
    > in 1. - without the try - exception statement the call is correct with the
    > correct parameter and throws an exception (that ends the debugging) with
    > an incorrect parameter
    > now I wanted to catch the correct exception, but I can only catch
    > CORBA.UserException in the right way
    >
    > What have I to do, to catch the derived exception?


    Asuming the userdefined exception MyException is defined in myfile:

    import myfile

    obj = # your initialization code

    try:
    obj.methodThatFails()
    except myfile.MyException:
    print "something went wrong in an organized manner"

    I am doubting if that is what you want, though. Maybe you could post some
    code and the traceback?
    Peter Otten, Aug 22, 2003
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Bob
    Replies:
    5
    Views:
    634
  2. CORBA Exception

    , Dec 6, 2005, in forum: Java
    Replies:
    0
    Views:
    716
  3. Raju
    Replies:
    0
    Views:
    330
  4. Tomek
    Replies:
    1
    Views:
    1,020
    Jack Klein
    Jun 1, 2006
  5. 7stud --
    Replies:
    11
    Views:
    407
    7stud --
    Nov 9, 2007
Loading...

Share This Page