If you want to throw a Throwable then you need to catch a Throwable. Exception is a subclass of Throwable so simply catching or throwing an Exception won't do.
You need to change line 1 toor line 10 to
Victor M. Pereira
Joined: Mar 02, 2012
Well the catch on line 10 is for trapping all exceptions that come of java.lang.reflection API. While the exception thrown by the methods that are invoked are the ones I need to throw.
Well I think I have spotted a small mistake on my code example. I'll try it and report on it.
Joined: Aug 05, 2005
But your testSomething method is declared to have a Throwable parameter and you try to throw (on line 9) whatever object that parameter refers to. It doesn't matter if, in your code, the actual object you pass in is only an Exception or one of its subclasses, you have said it is possible for that object to be a Throwable, so when you throw it your catch code has to handle Throwables or your method needs to be declared to throw a Throwable.