6 Replies Latest reply on Oct 3, 2008 7:08 PM by 843785

    Catching exception from inherited constructor

      Hi all,

      If I'm extending a class and the constructor of the parent class throws an exception, is there any way to catch that exception in my constructor? What I would like to do is something like this.
      public class MyClass extends OtherClass {    // the constructor for OtherClass throws an exception
          public MyClass() {
              try {
              } catch (Exception e) {}
      But of course you can't do that because super() has to be the first command in the method. Is there any other way to accomplish this? My objective is to chain this exception to a different type of exception.