[jboss-dev-forums] [Design of Messaging on JBoss (Messaging/JBoss)] - Re: Propagation of exceptions to client

timfox do-not-reply at jboss.com
Fri Jul 21 03:15:12 EDT 2006


I don't think clients should be exposed to the implementation details of why the server failed.

The server admin people need to know this, but not the client. The client needs to to know something went wrong (e.g. "failed to acknowledge"), but it's leaking implementation details when we tell them it's because of a nested com.acme.widget.WidgetException from line 760 of com.acme.widget.SnoopOnCustomersClass.class

Not only does this require them to have the jars on the client it means clients can start doing things like this:


  | try
  | {
  |    producer.send(message);
  | }
  | catch (JMSException e)
  | {
  |    Exception cause = e.getLinkedException();
  | 
  |    if (cause instanceof WidgetException)
  |    {
  |       // do something
  |    }
  | }
  | 

Now the client code is tightly coupled to server implementation details.

I don't think we should give clients rope, since some are sure to hang themselves with it.

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3959792#3959792

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3959792



More information about the jboss-dev-forums mailing list