dcsimg
Refined exception handling in clients
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Raj_Subramani
Posted On:   Wednesday, September 1, 2004 02:07 AM

I have implemented version control on my entity beans (see EJB Design Patterns ) which in turn throws a VersionMismatchException (which I have made a sub class of EJB Exception so as to make it a Runtime Exception) when a mismatch occurs. I notice that on my client (JUnit test) it is always caught as a RemoteException. So at the moment my client side colleagues are coding the handler as: if (e.getCause() instanceof VersionMismatchException) { //inform user and/or do something clever } else .... I feel that this is rather clumsy. Is this the only way or has anyone come across something better. If you have then I would appreciate    More>>

I have implemented version control on my entity beans (see EJB Design Patterns ) which in turn throws a VersionMismatchException (which I have made a sub class of EJB Exception so as to make it a Runtime Exception) when a mismatch occurs.



I notice that on my client (JUnit test) it is always caught as a RemoteException. So at the moment my client side colleagues are coding the handler as:

			
if (e.getCause() instanceof VersionMismatchException)
{
//inform user and/or do something clever
}
else ....



I feel that this is rather clumsy. Is this the only way or has anyone come across something better.



If you have then I would appreciate if you could share the experience.



Cheers

-raj

   <<Less
About | Sitemap | Contact