Skip to content

Commit

Permalink
fix: better formatting for error messages (#1833)
Browse files Browse the repository at this point in the history
  • Loading branch information
ischasny authored Nov 29, 2023
1 parent 6e412c2 commit af35adb
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions lib/mpoolmonitor/mpoolmonitor.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,11 +188,17 @@ func (mm *MpoolMonitor) MsgExecElapsedEpochs(ctx context.Context, msgCid cid.Cid
x, err := mm.fullNode.StateSearchMsg(ctx, types.EmptyTSK, msgCid, abi.ChainEpoch(20), true)
// check for nil is required as the StateSearchMsg / ChainHead sometimes return a nil pointer
// without an error (TODO: investigate) that has caused panics in boost
if x == nil || err != nil {
if x == nil {
return found, 0, fmt.Errorf("Message not yet found in state store")
}
if err != nil {
return found, 0, fmt.Errorf("searching message: %w", err)
}
c, err := mm.fullNode.ChainHead(ctx)
if c == nil || err != nil {
if c == nil {
return found, 0, fmt.Errorf("chain head is nil")
}
if err != nil {
return found, 0, fmt.Errorf("getting chain head: %w", err)
}
return found, c.Height() - x.Height, nil
Expand Down

0 comments on commit af35adb

Please sign in to comment.