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

scott.stark@jboss.org do-not-reply at jboss.com
Sat Jul 22 10:37:40 EDT 2006


I think we should be marshalling the exception message without the type to ensure info is not throw away:


  | import java.io.StringWriter;
  | import java.io.PrintWriter;
  | 
  |       try
  |       {
  |          ...
  |       }
  |       catch(Throwable e)
  |       {
  |          StringWriter sw = new StringWriter(256);
  |          PrintWriter pw = new PrintWriter(sw);
  |          pw.println("Cause:");
  |          e.printStackTrace(pw);
  |          pw.close();
  |          String reason = sw.toString();
  |          JMSException ex = new JMSException(reason);
  |          throw ex;
  |       }
  | 


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

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



More information about the jboss-dev-forums mailing list