Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: better formatting for error messages #1833

Merged
merged 2 commits into from
Nov 29, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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("searching message is nil")
ischasny marked this conversation as resolved.
Show resolved Hide resolved
}
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