Skip to content

Commit 8320447

Browse files
improve error messages (#203)
* improve error messages * Update modules/light-clients/07-tendermint/types/client_state.go Co-authored-by: Aditya <adityasripal@gmail.com> Co-authored-by: Aditya <adityasripal@gmail.com>
1 parent 4db5fd1 commit 8320447

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

modules/core/04-channel/keeper/packet.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -471,7 +471,7 @@ func (k Keeper) AcknowledgePacket(
471471
commitment := k.GetPacketCommitment(ctx, packet.GetSourcePort(), packet.GetSourceChannel(), packet.GetSequence())
472472

473473
if len(commitment) == 0 {
474-
return sdkerrors.Wrapf(types.ErrPacketCommitmentNotFound, "packet with sequence (%d) has been acknowledged, or timed out. In rare cases the packet was never sent or the packet sequence is incorrect", packet.GetSequence())
474+
return sdkerrors.Wrapf(types.ErrPacketCommitmentNotFound, "packet with sequence (%d) has been acknowledged, or timed out. In rare cases, the packet referenced was never sent, likely due to the relayer being misconfigured", packet.GetSequence())
475475
}
476476

477477
packetCommitment := types.CommitPacket(k.cdc, packet)

modules/core/04-channel/keeper/timeout.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ func (k Keeper) TimeoutPacket(
8181
commitment := k.GetPacketCommitment(ctx, packet.GetSourcePort(), packet.GetSourceChannel(), packet.GetSequence())
8282

8383
if len(commitment) == 0 {
84-
return sdkerrors.Wrapf(types.ErrPacketCommitmentNotFound, "packet with sequence (%d) has been acknowledged or timed out. In rare cases the packet was never sent or the packet sequence is incorrect", packet.GetSequence())
84+
return sdkerrors.Wrapf(types.ErrPacketCommitmentNotFound, "packet with sequence (%d) has been acknowledged or timed out. In rare cases, the packet referenced was never sent, likely due to the relayer being misconfigured", packet.GetSequence())
8585
}
8686

8787
packetCommitment := types.CommitPacket(k.cdc, packet)

modules/light-clients/07-tendermint/types/client_state.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -568,7 +568,7 @@ func produceVerificationArgs(
568568

569569
consensusState, err = GetConsensusState(store, cdc, height)
570570
if err != nil {
571-
return commitmenttypes.MerkleProof{}, nil, err
571+
return commitmenttypes.MerkleProof{}, nil, sdkerrors.Wrap(err, "please ensure the proof was constructed against a height that exists on the client")
572572
}
573573

574574
return merkleProof, consensusState, nil

0 commit comments

Comments
 (0)