异常和错误提示修改

back_recharge
zhangshanxue 2019-10-24 10:34:02 +08:00
parent bbfbfc5c9b
commit d2be1a3355
4 changed files with 9 additions and 3 deletions

View File

@ -192,7 +192,8 @@ public class HandlerLogicThread extends Thread{
return;
}
UserManager.addUser(user);
MessageUtil.sendErrorCode(session,session.getLastMsgId()+1, SErrorCodeEerverConfig.getI18NMessage("bug_unify_txt"));
MessageUtil.sendErrorResponse(session, 0, session.getLastMsgId() + 1,"");
// MessageUtil.sendErrorCode(session,session.getLastMsgId()+1, SErrorCodeEerverConfig.getI18NMessage("bug_unify_txt"));
}catch (Exception e1){}
}else {

View File

@ -19,6 +19,11 @@ public class ErrorCodeException extends Exception {
this.params = params;
}
public ErrorCodeException(String message, ErrorCode errorCode) {
super(message);
this.errorCode = errorCode;
}
public ErrorCodeException(String message, ErrorCode errorCode, List<String> params) {
super(message);
this.errorCode = errorCode;

View File

@ -86,7 +86,7 @@ public class ExchangeCdkHandler extends BaseHandler<PlayerInfoProto.ExchangeCdkR
long size = MongoUtil.getCoreMongoTemplate().count(new BasicQuery(new BasicDBObject("uid", uid).append("goodsId", goodsId)), CdkUseInfo.class);
if (size >= scdkInfo.getRoleUseNum()) {
throw new ErrorCodeException(ErrorCode.CDK_ROLELIMIT);
throw new ErrorCodeException(ErrorCode.CDK_ROLE_LIMIT);
}
BasicDBObject basicDBObject = new BasicDBObject();

View File

@ -130,7 +130,7 @@ public class PlayerLogic {
if (PlayerLogic.getInstance().isExistName(name)) {
// MessageUtil.sendErrorResponse(iSession, 0, msgId, SErrorCodeEerverConfig.getI18NMessage("name_repeat_txt"));
// return;
throw new ErrorCodeException(ErrorCode.NAME_USE);
throw new ErrorCodeException(name,ErrorCode.NAME_USE);
}
if (!playerInfoManager.getNickName().equals(String.valueOf(uid))){
String delkey = RedisKey.getKey(RedisKey.C_User_Name_Key, playerInfoManager.getNickName(), false);