Improve error logs

This commit is contained in:
Manfred Karrer 2019-01-03 10:16:26 +01:00
parent 1b17109b6b
commit a7be0c4d31
No known key found for this signature in database
GPG key ID: 401250966A6B2C46

View file

@ -124,15 +124,18 @@ public class VoteResultConsensus {
blindVoteTxId + " not found.");
Tx blindVoteTx = optionalBlindVoteTx.get();
Optional<TxType> optionalTxType = daoStateService.getOptionalTxType(blindVoteTx.getId());
checkArgument(optionalTxType.isPresent(), "optionalTxType must be present");
checkArgument(optionalTxType.isPresent(), "optionalTxType must be present" +
". blindVoteTxId=" + blindVoteTx.getId());
checkArgument(optionalTxType.get() == TxType.BLIND_VOTE,
"blindVoteTx must have type BLIND_VOTE");
"blindVoteTx must have type BLIND_VOTE but is " + optionalTxType.get() +
". blindVoteTxId=" + blindVoteTx.getId());
checkArgument(periodService.isTxInCorrectCycle(blindVoteTx.getBlockHeight(), chainHeight),
"blindVoteTx is not in correct cycle. blindVoteTx.getBlockHeight()="
+ blindVoteTx.getBlockHeight());
+ blindVoteTx.getBlockHeight() + ". chainHeight=" + chainHeight +
". blindVoteTxId=" + blindVoteTx.getId());
checkArgument(periodService.isInPhase(blindVoteTx.getBlockHeight(), DaoPhase.Phase.BLIND_VOTE),
"blindVoteTx is not in BLIND_VOTE phase. blindVoteTx.getBlockHeight()="
+ blindVoteTx.getBlockHeight());
+ blindVoteTx.getBlockHeight() + ". blindVoteTxId=" + blindVoteTx.getId());
return blindVoteTx;
} catch (Throwable t) {
throw new VoteResultException.ValidationException(t);