INT-1110 Add Message to MessageMappingException in outbound tcp adapter. Add code to the dispatchers to do the same if a handler does not.

This commit is contained in:
Gary Russell
2010-05-01 00:35:37 +00:00
parent 6aea96e2b2
commit efa7d7fd88
6 changed files with 106 additions and 4 deletions

View File

@@ -107,7 +107,7 @@ public abstract class AbstractTcpSendingMessageHandler extends
byte[] bytes = mapper.fromMessage(message);
SocketWriter writer = this.getWriter();
if (writer == null) {
throw new MessageMappingException("Failed to create SocketWriter");
throw new MessageMappingException(message, "Failed to create SocketWriter");
}
writer.write(bytes);
} catch (Exception e) {
@@ -115,7 +115,7 @@ public abstract class AbstractTcpSendingMessageHandler extends
if (e instanceof MessageMappingException) {
throw (MessageMappingException) e;
}
throw new MessageMappingException("Failed to map message", e);
throw new MessageMappingException(message, "Failed to map message", e);
}
}