diff --git a/common/src/main/java/org/tron/core/exception/TronError.java b/common/src/main/java/org/tron/core/exception/TronError.java index 2ea07499e5..f407c6dfe3 100644 --- a/common/src/main/java/org/tron/core/exception/TronError.java +++ b/common/src/main/java/org/tron/core/exception/TronError.java @@ -47,8 +47,9 @@ public enum ErrCode { LOG_LOAD(1), WITNESS_INIT(1), RATE_LIMITER_INIT(1), - JDK_VERSION(1), - SOLID_NODE_INIT(0); + SOLID_NODE_INIT(0), + PARAMETER_INIT(1), + JDK_VERSION(1); private final int code; diff --git a/framework/src/main/java/org/tron/core/config/args/Args.java b/framework/src/main/java/org/tron/core/config/args/Args.java index 27739ff432..df32ec9a00 100644 --- a/framework/src/main/java/org/tron/core/config/args/Args.java +++ b/framework/src/main/java/org/tron/core/config/args/Args.java @@ -12,6 +12,7 @@ import static org.tron.core.Constant.MIN_PROPOSAL_EXPIRE_TIME; import static org.tron.core.config.Parameter.ChainConstant.BLOCK_PRODUCE_TIMEOUT_PERCENT; import static org.tron.core.config.Parameter.ChainConstant.MAX_ACTIVE_WITNESS_NUM; +import static org.tron.core.exception.TronError.ErrCode.PARAMETER_INIT; import com.beust.jcommander.JCommander; import com.beust.jcommander.ParameterDescription; @@ -1288,17 +1289,16 @@ public static void setParam(final Config config) { private static long getProposalExpirationTime(final Config config) { if (config.hasPath(Constant.COMMITTEE_PROPOSAL_EXPIRE_TIME)) { - throw new IllegalArgumentException("It is not allowed to configure " - + "commit.proposalExpireTime in config.conf, please set the value in " - + "block.proposalExpireTime."); + throw new TronError("It is not allowed to configure committee.proposalExpireTime in " + + "config.conf, please set the value in block.proposalExpireTime.", PARAMETER_INIT); } if (config.hasPath(Constant.BLOCK_PROPOSAL_EXPIRE_TIME)) { long proposalExpireTime = config.getLong(Constant.BLOCK_PROPOSAL_EXPIRE_TIME); if (proposalExpireTime <= MIN_PROPOSAL_EXPIRE_TIME || proposalExpireTime >= MAX_PROPOSAL_EXPIRE_TIME) { - throw new IllegalArgumentException("The value[block.proposalExpireTime] is only allowed to " + throw new TronError("The value[block.proposalExpireTime] is only allowed to " + "be greater than " + MIN_PROPOSAL_EXPIRE_TIME + " and less than " - + MAX_PROPOSAL_EXPIRE_TIME + "!"); + + MAX_PROPOSAL_EXPIRE_TIME + "!", PARAMETER_INIT); } return proposalExpireTime; } else {