On 09/04/07, Rupert Smith <[EMAIL PROTECTED]> wrote:
Yes, there's quite a lot of it in there. I'm going to leave some of it well
alone for the moment, but fix some things that don't really alter the
semantics of the code:

Here's one. Don't do this:

catch (SomeException e)
{
   throw new MyException("Something went wrong.");
}

Do this instead:

catch (SomeException e)
{
  throw new MyException("Something went wrong.", e);
}

of for JMSException which doesn't accept wrapped exceptions through its
constructors, have to do something like:

catch (SomeException e)
{
  JMSException jmse = new JMSException("Something went wrong.");
  jmse.setLinkedException(e);
  throw jmse;
}

This isn't majorly wrong, just annoying to lose half the exception stack
trace, when tracking down bugs from log files.

Rupert



We did get fed up of the diong the .setLinkedException on JMSE so we
created AMQJMSException (or is it JMSAMQException) that does the
correct wrapping :)

--
Martin Ritchie

Reply via email to