try {
agentToWorkgroup(packet);
}
catch (AgentNotFoundException e) {
Presence reply = new Presence();
reply.setError(new PacketError(PacketError.Condition.not_authorized));
reply.setTo(packet.getFrom());
reply.setFrom(workgroup.getJID());
workgroup.send(reply);
StringBuilder errorMessage = new StringBuilder();
errorMessage.append("Sender: ");
errorMessage.append(packet.getFrom().toString());
errorMessage.append(" Workgroup: ");
errorMessage.append(workgroup.getJID().toString());
Log.debug(errorMessage.toString(), e);
}
}
}
catch (Exception e) {
Log.error(e.getMessage(), e);
Presence reply = new Presence();
reply.setError(new PacketError(PacketError.Condition.internal_server_error));
reply.setTo(packet.getFrom());
reply.setFrom(workgroup.getJID());
workgroup.send(reply);
}
}