add exception log

This commit is contained in:
heavyrain.lee
2020-01-10 12:34:31 +08:00
parent a856b96b59
commit 2e4cf566c7
14 changed files with 51 additions and 1 deletions
@@ -13,6 +13,7 @@ import io.moquette.spi.impl.Qos1PublishHandler;
import io.netty.buffer.ByteBuf;
import cn.wildfirechat.common.ErrorCode;
import win.liyufan.im.IMTopic;
import win.liyufan.im.Utility;
@Handler(IMTopic.ModifyMyInfoTopic)
public class ModifyMyInfoHandler extends IMHandler<WFCMessage.ModifyMyInfoRequest> {
@@ -22,6 +23,7 @@ public class ModifyMyInfoHandler extends IMHandler<WFCMessage.ModifyMyInfoReques
return m_messagesStore.modifyUserInfo(fromUser, request);
} catch (Exception e) {
e.printStackTrace();
Utility.printExecption(LOG, e);
return ErrorCode.ERROR_CODE_SERVER_ERROR;
}
}
@@ -17,6 +17,7 @@ import io.netty.buffer.ByteBuf;
import cn.wildfirechat.common.ErrorCode;
import win.liyufan.im.IMTopic;
import win.liyufan.im.MessageShardingUtil;
import win.liyufan.im.Utility;
import java.util.Set;
@@ -39,12 +40,14 @@ public class SendMessageHandler extends IMHandler<WFCMessage.Message> {
mSensitiveType = Integer.parseInt(mServer.getConfig().getProperty(BrokerConstants.SENSITIVE_Filter_Type));
} catch (Exception e) {
e.printStackTrace();
Utility.printExecption(LOG, e);
}
try {
mBlacklistStrategy = Integer.parseInt(mServer.getConfig().getProperty(BrokerConstants.MESSAGE_Blacklist_Strategy));
} catch (Exception e) {
e.printStackTrace();
Utility.printExecption(LOG, e);
}
}
@@ -138,30 +138,35 @@ public class MemoryMessagesStore implements IMessagesStore {
mDisableStrangerChat = Boolean.parseBoolean(m_Server.getConfig().getProperty(BrokerConstants.MESSAGE_Disable_Stranger_Chat));
} catch (Exception e) {
e.printStackTrace();
Utility.printExecption(LOG, e);
}
try {
mFriendRequestDuration = Long.parseLong(m_Server.getConfig().getProperty(FRIEND_Repeat_Request_Duration));
} catch (Exception e) {
e.printStackTrace();
Utility.printExecption(LOG, e);
}
try {
mFriendRejectDuration = Long.parseLong(m_Server.getConfig().getProperty(FRIEND_Reject_Request_Duration));
} catch (Exception e) {
e.printStackTrace();
Utility.printExecption(LOG, e);
}
try {
mChatroomRejoinWhenActive = Boolean.parseBoolean(m_Server.getConfig().getProperty(BrokerConstants.CHATROOM_Rejoin_When_Active));
} catch (Exception e) {
e.printStackTrace();
Utility.printExecption(LOG, e);
}
try {
mChatroomParticipantIdleTime = Long.parseLong(m_Server.getConfig().getProperty(CHATROOM_Participant_Idle_Time, "900000"));
} catch (Exception e) {
e.printStackTrace();
Utility.printExecption(LOG, e);
}
}
@@ -1545,6 +1550,7 @@ public class MemoryMessagesStore implements IMessagesStore {
databaseStore.updateUser(us);
} catch (Exception e) {
e.printStackTrace();
Utility.printExecption(LOG, e);
}
mUserMap.put(userId, us);
}
@@ -2296,6 +2302,7 @@ public class MemoryMessagesStore implements IMessagesStore {
}
} catch (Exception e) {
e.printStackTrace();
Utility.printExecption(LOG, e);
}
}
@@ -2506,6 +2513,7 @@ public class MemoryMessagesStore implements IMessagesStore {
newInfoBuilder.setAutomatic(Integer.parseInt(value));
} catch (Exception e) {
e.printStackTrace();
Utility.printExecption(LOG, e);
}
}
@@ -29,6 +29,7 @@ import io.moquette.spi.IMessagesStore.StoredMessage;
import io.netty.handler.codec.mqtt.MqttVersion;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import win.liyufan.im.Utility;
import java.util.*;
import java.util.concurrent.*;
@@ -272,6 +273,7 @@ public class MemorySessionStore implements ISessionsStore {
supportMultiEndpoint = Boolean.parseBoolean(server.getConfig().getProperty(BrokerConstants.SERVER_MULTI_ENDPOINT));
} catch (Exception e) {
e.printStackTrace();
Utility.printExecption(LOG, e);
}
}
@@ -87,6 +87,7 @@ public class MessagesPublisher {
Thread.sleep(1000);
} catch (InterruptedException e) {
e.printStackTrace();
Utility.printExecption(LOG, e);
}
chatroomScheduler.shutdown();
}
@@ -187,6 +187,7 @@ public class Qos1PublishHandler extends QosPublishHandler {
gzip.close();
} catch (Exception e) {
e.printStackTrace();
Utility.printExecption(LOG, e);
}
data = out.toByteArray();
code = (byte)ErrorCode.ERROR_CODE_SUCCESS_GZIPED.code;