|
11 | 11 | import static org.tron.core.Constant.MIN_PROPOSAL_EXPIRE_TIME; |
12 | 12 | import static org.tron.core.config.Parameter.ChainConstant.BLOCK_PRODUCE_TIMEOUT_PERCENT; |
13 | 13 | import static org.tron.core.config.Parameter.ChainConstant.MAX_ACTIVE_WITNESS_NUM; |
| 14 | +import static org.tron.core.exception.TronError.ErrCode.PARAMETER_INIT; |
14 | 15 |
|
15 | 16 | import com.beust.jcommander.JCommander; |
16 | 17 | import com.beust.jcommander.ParameterDescription; |
@@ -1276,17 +1277,16 @@ public static void setParam(final Config config) { |
1276 | 1277 |
|
1277 | 1278 | private static long getProposalExpirationTime(final Config config) { |
1278 | 1279 | if (config.hasPath(Constant.COMMITTEE_PROPOSAL_EXPIRE_TIME)) { |
1279 | | - throw new IllegalArgumentException("It is not allowed to configure " |
1280 | | - + "commit.proposalExpireTime in config.conf, please set the value in " |
1281 | | - + "block.proposalExpireTime."); |
| 1280 | + throw new TronError("It is not allowed to configure committee.proposalExpireTime in " |
| 1281 | + + "config.conf, please set the value in block.proposalExpireTime.", PARAMETER_INIT); |
1282 | 1282 | } |
1283 | 1283 | if (config.hasPath(Constant.BLOCK_PROPOSAL_EXPIRE_TIME)) { |
1284 | 1284 | long proposalExpireTime = config.getLong(Constant.BLOCK_PROPOSAL_EXPIRE_TIME); |
1285 | 1285 | if (proposalExpireTime <= MIN_PROPOSAL_EXPIRE_TIME |
1286 | 1286 | || proposalExpireTime >= MAX_PROPOSAL_EXPIRE_TIME) { |
1287 | | - throw new IllegalArgumentException("The value[block.proposalExpireTime] is only allowed to " |
| 1287 | + throw new TronError("The value[block.proposalExpireTime] is only allowed to " |
1288 | 1288 | + "be greater than " + MIN_PROPOSAL_EXPIRE_TIME + " and less than " |
1289 | | - + MAX_PROPOSAL_EXPIRE_TIME + "!"); |
| 1289 | + + MAX_PROPOSAL_EXPIRE_TIME + "!", PARAMETER_INIT); |
1290 | 1290 | } |
1291 | 1291 | return proposalExpireTime; |
1292 | 1292 | } else { |
|
0 commit comments