0 Replies Latest reply on Oct 21, 2008 8:12 AM by André Dantas Rocha

    Insert code just after catch

    André Dantas Rocha Newbie

      Hi all,

      I've been trying (without success) insert code in specific places on method's body. I need to handle all exceptions using a specific class.

      Something like it:

      method (param1, param2) {
       try {
       ...
       } catch (IOException e) {
       Myhandler.handler(e, param1, param2) // <-- inserted by Javassist
       ...
       } catch (Exception e) {
       Myhandler.handler(e, param1, param2) // <-- inserted by Javassist
       ...
       }
      }
      


      How can I how to do this? I didn't find any way to replace code inside a method...

      Thank you very much,

      Andre