Merge pull request #252 from filecoin-project/feat/error-annotations
Add some more error annotations
This commit is contained in:
commit
3c0c3d7cc4
@ -108,7 +108,7 @@ func (st *StateTree) GetActor(addr address.Address) (*types.Actor, error) {
|
||||
if err == hamt.ErrNotFound {
|
||||
return nil, types.ErrActorNotFound
|
||||
}
|
||||
return nil, err
|
||||
return nil, xerrors.Errorf("hamt find failed: %w", err)
|
||||
}
|
||||
|
||||
st.actorcache[addr] = &act
|
||||
|
@ -3,6 +3,7 @@ package stmgr
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
"github.com/filecoin-project/go-lotus/chain/actors"
|
||||
"github.com/filecoin-project/go-lotus/chain/types"
|
||||
"github.com/filecoin-project/go-lotus/chain/vm"
|
||||
@ -29,7 +30,7 @@ func (sm *StateManager) CallRaw(ctx context.Context, msg *types.Message, bstate
|
||||
|
||||
fromActor, err := vmi.StateTree().GetActor(msg.From)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
return nil, xerrors.Errorf("call raw get actor: %s", err)
|
||||
}
|
||||
|
||||
msg.Nonce = fromActor.Nonce
|
||||
@ -54,7 +55,7 @@ func (sm *StateManager) Call(ctx context.Context, msg *types.Message, ts *types.
|
||||
|
||||
state, err := sm.TipSetState(ts.Cids())
|
||||
if err != nil {
|
||||
return nil, err
|
||||
return nil, xerrors.Errorf("getting tipset state: %w", err)
|
||||
}
|
||||
|
||||
r := vm.NewChainRand(sm.cs, ts.Cids(), ts.Height(), nil)
|
||||
|
@ -5,9 +5,10 @@ import (
|
||||
"crypto/sha256"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"github.com/filecoin-project/go-lotus/build"
|
||||
"sync"
|
||||
|
||||
"github.com/filecoin-project/go-lotus/build"
|
||||
|
||||
amt "github.com/filecoin-project/go-amt-ipld"
|
||||
"github.com/filecoin-project/go-lotus/chain/types"
|
||||
|
||||
@ -97,7 +98,7 @@ func (cs *ChainStore) Load() error {
|
||||
|
||||
ts, err := cs.LoadTipSet(tscids)
|
||||
if err != nil {
|
||||
return err
|
||||
return xerrors.Errorf("loading tipset: %w", err)
|
||||
}
|
||||
|
||||
cs.heaviest = ts
|
||||
@ -262,7 +263,7 @@ func (cs *ChainStore) LoadTipSet(cids []cid.Cid) (*types.TipSet, error) {
|
||||
for _, c := range cids {
|
||||
b, err := cs.GetBlock(c)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
return nil, xerrors.Errorf("get block %s: %w", c, err)
|
||||
}
|
||||
|
||||
blks = append(blks, b)
|
||||
|
Loading…
Reference in New Issue
Block a user