Remvoe errors package from libs (#4157)

*libs/common/errors: remove package

- remove errors file from cmn pkg

- use errorf instead of wrap in async function

- add changelog entry

- closes #3862
This commit is contained in:
Marko
2019-11-19 12:47:22 +01:00
committed by GitHub
parent 8a878c1cad
commit aca94fd9a0
7 changed files with 38 additions and 347 deletions

View File

@@ -24,7 +24,7 @@ func GetWithProof(prt *merkle.ProofRuntime, key []byte, reqHeight int64, node rp
val cmn.HexBytes, height int64, proof *merkle.Proof, err error) {
if reqHeight < 0 {
err = cmn.NewError("Height cannot be negative")
err = errors.New("Height cannot be negative")
return
}
@@ -54,7 +54,7 @@ func GetWithProofOptions(prt *merkle.ProofRuntime, path string, key []byte, opts
// Validate the response, e.g. height.
if resp.IsErr() {
err = cmn.NewError("Query error for key %d: %d", key, resp.Code)
err = errors.Errorf("Query error for key %d: %d", key, resp.Code)
return nil, err
}
@@ -62,7 +62,7 @@ func GetWithProofOptions(prt *merkle.ProofRuntime, path string, key []byte, opts
return nil, lerr.ErrEmptyTree()
}
if resp.Height == 0 {
return nil, cmn.NewError("Height returned is zero")
return nil, errors.New("Height returned is zero")
}
// AppHash for height H is in header H+1