View Single Post
  #1 (permalink)  
Old 03-27-2008, 12:19 PM
rjuyal's Avatar
rjuyal rjuyal is offline
Senior Member
 
Join Date: Mar 2008
Location: Delhi, India
Posts: 100
rjuyal is on a distinguished road
HELP: Method Invocation
Hi All,

i am using

method.invoke method to invoke some methods

For Eg:
if ( i == 1 )
// get the method fun1 ( ... ) in method
method.invoke ( this, args... );
if ( i == 2 )
// get the method fun2 ( ... ) in method
method.invoke ( this, diffArgs... );


everything is working fine. It is calling the function , now i am throwing an user created Exception ( HMSException ) from the method fun1 ( ... ).

but when i but a try catch block in

try{
method.invoke ( this, args... );
}catch ( HMSException e ) {
print ( "Never got Caught" );
}

i am unable to catch the exception.


try{
method.invoke ( this, args... );
}catch ( Exception e ) {
print ( "Now it catches the correct Exception means same message." );
}

It works fine now, but the game is i want to catch the Exception which i haev thrown not the JAVA Exception...
Reply With Quote
Sponsored Links