{
response = new NullResponseMessage();
}
else
{
response = new HornetQExceptionMessage(new HornetQException(HornetQException.DUPLICATE_METADATA,
"Metadata " + message.getKey() +
"=" +
message.getData() +
" had been set already"));
}
break;
}
}
}
catch (HornetQXAException e)
{
if (requiresResponse)
{
log.debug("Sending exception to client", e);
response = new SessionXAResponseMessage(true, e.errorCode, e.getMessage());
}
else
{
log.error("Caught XA exception", e);
}
}
catch (HornetQException e)
{
if (requiresResponse)
{
log.debug("Sending exception to client", e);
response = new HornetQExceptionMessage((HornetQException)e);
}
else
{
log.error("Caught exception", e);
}
}
catch (Throwable t)
{
if (requiresResponse)
{
log.warn("Sending unexpected exception to the client", t);
HornetQException hqe = new HornetQException(HornetQException.INTERNAL_ERROR);
hqe.initCause(t);
response = new HornetQExceptionMessage(hqe);
}
else
{
log.error("Caught unexpected exception", t);
}