|
12 | 12 | import static org.tron.core.Constant.MIN_PROPOSAL_EXPIRE_TIME; |
13 | 13 | import static org.tron.core.config.Parameter.ChainConstant.BLOCK_PRODUCE_TIMEOUT_PERCENT; |
14 | 14 | import static org.tron.core.config.Parameter.ChainConstant.MAX_ACTIVE_WITNESS_NUM; |
| 15 | +import static org.tron.core.exception.TronError.ErrCode.PARAMETER_INIT; |
15 | 16 |
|
16 | 17 | import com.beust.jcommander.JCommander; |
17 | 18 | import com.beust.jcommander.ParameterDescription; |
@@ -1288,17 +1289,16 @@ public static void setParam(final Config config) { |
1288 | 1289 |
|
1289 | 1290 | private static long getProposalExpirationTime(final Config config) { |
1290 | 1291 | if (config.hasPath(Constant.COMMITTEE_PROPOSAL_EXPIRE_TIME)) { |
1291 | | - throw new IllegalArgumentException("It is not allowed to configure " |
1292 | | - + "commit.proposalExpireTime in config.conf, please set the value in " |
1293 | | - + "block.proposalExpireTime."); |
| 1292 | + throw new TronError("It is not allowed to configure committee.proposalExpireTime in " |
| 1293 | + + "config.conf, please set the value in block.proposalExpireTime.", PARAMETER_INIT); |
1294 | 1294 | } |
1295 | 1295 | if (config.hasPath(Constant.BLOCK_PROPOSAL_EXPIRE_TIME)) { |
1296 | 1296 | long proposalExpireTime = config.getLong(Constant.BLOCK_PROPOSAL_EXPIRE_TIME); |
1297 | 1297 | if (proposalExpireTime <= MIN_PROPOSAL_EXPIRE_TIME |
1298 | 1298 | || proposalExpireTime >= MAX_PROPOSAL_EXPIRE_TIME) { |
1299 | | - throw new IllegalArgumentException("The value[block.proposalExpireTime] is only allowed to " |
| 1299 | + throw new TronError("The value[block.proposalExpireTime] is only allowed to " |
1300 | 1300 | + "be greater than " + MIN_PROPOSAL_EXPIRE_TIME + " and less than " |
1301 | | - + MAX_PROPOSAL_EXPIRE_TIME + "!"); |
| 1301 | + + MAX_PROPOSAL_EXPIRE_TIME + "!", PARAMETER_INIT); |
1302 | 1302 | } |
1303 | 1303 | return proposalExpireTime; |
1304 | 1304 | } else { |
|
0 commit comments