Merge PR #3557: Removing pkg/errors when not necessary

This commit is contained in:
Juan Leni
2019-02-08 11:37:46 -08:00
committed by Jack Zampolin
parent 7bc837aa06
commit ba63eb1801
19 changed files with 44 additions and 42 deletions
+3 -3
View File
@@ -1,7 +1,7 @@
package context
import (
"github.com/pkg/errors"
"fmt"
sdk "github.com/cosmos/cosmos-sdk/types"
)
@@ -39,11 +39,11 @@ func (ctx CLIContext) BroadcastTxAndAwaitCommit(tx []byte) (sdk.TxResponse, erro
}
if !res.CheckTx.IsOK() {
return sdk.NewResponseFormatBroadcastTxCommit(res), errors.Errorf(res.CheckTx.Log)
return sdk.NewResponseFormatBroadcastTxCommit(res), fmt.Errorf(res.CheckTx.Log)
}
if !res.DeliverTx.IsOK() {
return sdk.NewResponseFormatBroadcastTxCommit(res), errors.Errorf(res.DeliverTx.Log)
return sdk.NewResponseFormatBroadcastTxCommit(res), fmt.Errorf(res.DeliverTx.Log)
}
return sdk.NewResponseFormatBroadcastTxCommit(res), err
+3 -3
View File
@@ -1,7 +1,7 @@
package context
import (
"github.com/pkg/errors"
"fmt"
sdk "github.com/cosmos/cosmos-sdk/types"
)
@@ -9,7 +9,7 @@ import (
// ErrInvalidAccount returns a standardized error reflecting that a given
// account address does not exist.
func ErrInvalidAccount(addr sdk.AccAddress) error {
return errors.Errorf(`No account with address %s was found in the state.
return fmt.Errorf(`No account with address %s was found in the state.
Are you sure there has been a transaction involving it?`, addr)
}
@@ -17,6 +17,6 @@ Are you sure there has been a transaction involving it?`, addr)
// height can't be verified. The reason is that the base checkpoint of the certifier is
// newer than the given height
func ErrVerifyCommit(height int64) error {
return errors.Errorf(`The height of base truststore in gaia-lite is higher than height %d.
return fmt.Errorf(`The height of base truststore in gaia-lite is higher than height %d.
Can't verify blockchain proof at this height. Please set --trust-node to true and try again`, height)
}
+1 -1
View File
@@ -164,7 +164,7 @@ func (ctx CLIContext) query(path string, key cmn.HexBytes) (res []byte, err erro
resp := result.Response
if !resp.IsOK() {
return res, errors.Errorf(resp.Log)
return res, errors.New(resp.Log)
}
// data from trusted node or subspace query doesn't need verification
+3 -2
View File
@@ -6,9 +6,10 @@ import (
"os"
"strings"
"errors"
"github.com/bgentry/speakeasy"
"github.com/mattn/go-isatty"
"github.com/pkg/errors"
)
// MinPassLength is the minimum acceptable password length
@@ -36,7 +37,7 @@ func GetPassword(prompt string, buf *bufio.Reader) (pass string, err error) {
if len(pass) < MinPassLength {
// Return the given password to the upstream client so it can handle a
// non-STDIN failure gracefully.
return pass, errors.Errorf("password must be at least %d characters", MinPassLength)
return pass, fmt.Errorf("password must be at least %d characters", MinPassLength)
}
return pass, nil
+3 -2
View File
@@ -14,8 +14,9 @@ import (
"github.com/cosmos/cosmos-sdk/crypto/keys"
sdk "github.com/cosmos/cosmos-sdk/types"
"errors"
"github.com/gorilla/mux"
"github.com/pkg/errors"
"github.com/spf13/cobra"
"github.com/spf13/viper"
@@ -297,7 +298,7 @@ func printCreate(info keys.Info, showMnemonic bool, mnemonic string) error {
}
fmt.Fprintln(os.Stderr, string(jsonString))
default:
return errors.Errorf("I can't speak: %s", output)
return fmt.Errorf("I can't speak: %s", output)
}
return nil
+2 -1
View File
@@ -8,8 +8,9 @@ import (
"github.com/cosmos/cosmos-sdk/crypto/keys"
"errors"
"github.com/gorilla/mux"
"github.com/pkg/errors"
"github.com/spf13/cobra"
"github.com/spf13/viper"
"github.com/tendermint/tendermint/crypto/multisig"