Closed wsky closed 11 years ago
same as internalOnMessage
private void internalOnMessage(ChannelContext context, Message msg, Identity msgFrom) throws LinkException {
if (msg.messageType == MessageType.SENDACK) {
this.endpoint.getMessageHandler().onMessage(msg.content, msgFrom);
return;
}
EndpointContext endpointContext = new EndpointContext(
context, this.endpoint, msgFrom, msg.flag, msg.token);
endpointContext.setMessage(msg.content);
try {
this.endpoint.getMessageHandler().onMessage(endpointContext);
} catch (Exception e) {
// onMessage error should be reply to client
if (e instanceof LinkException)
endpointContext.error(
((LinkException) e).getErrorCode(),
((LinkException) e).getMessage());
else
endpointContext.error(0, e.getMessage());
}
}
if e from this:
if e2 was java.lang.NullPointerException, message was null, so both errorCode and message passed to client were null