Although, I notice that there is a JMSAMQException specifically for the case
where an AMQException is to be rethrown as a JMSException.
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