异常和错误提示修改

back_recharge
zhangshanxue 2019-11-01 10:13:50 +08:00
parent c304989a48
commit 5820505d71
1 changed files with 7 additions and 3 deletions

View File

@ -3,12 +3,15 @@ package com.ljsd.jieling.handler;
import com.google.protobuf.GeneratedMessage;
import com.google.protobuf.InvalidProtocolBufferException;
import com.google.protobuf.Parser;
import com.ljsd.jieling.core.HandlerLogicThread;
import com.ljsd.jieling.exception.ErrorCode;
import com.ljsd.jieling.exception.ErrorCodeException;
import com.ljsd.jieling.exception.LogicException;
import com.ljsd.jieling.netty.cocdex.PacketNetData;
import com.ljsd.jieling.network.session.ISession;
import com.ljsd.jieling.protocols.MessageTypeProto;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.lang.reflect.Field;
import java.lang.reflect.ParameterizedType;
@ -17,7 +20,7 @@ import java.lang.reflect.Type;
public abstract class BaseHandler<T extends GeneratedMessage> {
Class<T> protoClazz;
private static final Logger LOGGER = LoggerFactory.getLogger(BaseHandler.class);
public BaseHandler(){
getTClassIsNull();
}
@ -44,8 +47,9 @@ public abstract class BaseHandler<T extends GeneratedMessage> {
} catch(NoSuchFieldException|SecurityException|IllegalAccessException|IllegalArgumentException|ExceptionInInitializerError|InvalidProtocolBufferException var5){
throw new LogicException("解析协议失败",var5);
}catch (Exception var4) {
if(null !=proto&&!(var4 instanceof ErrorCodeException))
throw new LogicException("processWithProtoException\r\nprotoID:"+netData.getMsgId()+"\r\n"+proto.toString(),var4);
if(null !=proto){
LOGGER.error("processWithProtoException\r\nprotoID:"+netData.getMsgId()+"\r\n"+proto.toString());
}
}
}