OSDN Git Service

Small translation improvements during BM error reporting (#1693)
authorDimitris Sfounis <sfounisdimitris@gmail.com>
Tue, 16 Apr 2019 05:51:51 +0000 (08:51 +0300)
committerPaladz <yzhu101@uottawa.ca>
Tue, 16 Apr 2019 05:51:51 +0000 (13:51 +0800)
* Small translation improvement in error-reporting

* Small translation improvement in error-reporting, part two

account/accounts.go
api/errors.go

index 6667888..ab9bd9e 100644 (file)
@@ -47,16 +47,16 @@ var (
 
 // pre-define errors for supporting bytom errorFormatter
 var (
-       ErrDuplicateAlias  = errors.New("duplicate account alias")
-       ErrDuplicateIndex  = errors.New("duplicate account with same xPubs and index")
-       ErrFindAccount     = errors.New("fail to find account")
-       ErrMarshalAccount  = errors.New("failed marshal account")
-       ErrInvalidAddress  = errors.New("invalid address")
-       ErrFindCtrlProgram = errors.New("fail to find account control program")
-       ErrDeriveRule      = errors.New("invalid key derive rule")
-       ErrContractIndex   = errors.New("exceed the maximum addresses per account")
-       ErrAccountIndex    = errors.New("exceed the maximum accounts per xpub")
-       ErrFindTransaction = errors.New("no transaction")
+       ErrDuplicateAlias  = errors.New("Duplicate account alias")
+       ErrDuplicateIndex  = errors.New("Duplicate account with same xPubs and index")
+       ErrFindAccount     = errors.New("Failed to find account")
+       ErrMarshalAccount  = errors.New("Failed to marshal account")
+       ErrInvalidAddress  = errors.New("Invalid address")
+       ErrFindCtrlProgram = errors.New("Failed to find account control program")
+       ErrDeriveRule      = errors.New("Invalid key derivation rule")
+       ErrContractIndex   = errors.New("Exceeded maximum addresses per account")
+       ErrAccountIndex    = errors.New("Exceeded maximum accounts per xpub")
+       ErrFindTransaction = errors.New("No transaction")
 )
 
 // ContractKey account control promgram store prefix
index 77a1507..5ea054e 100644 (file)
@@ -59,17 +59,17 @@ var respErrFormatter = map[error]httperror.Info{
        account.ErrInsufficient:         {400, "BTM700", "Funds of account are insufficient"},
        account.ErrImmature:             {400, "BTM701", "Available funds of account are immature"},
        account.ErrReserved:             {400, "BTM702", "Available UTXOs of account have been reserved"},
-       account.ErrMatchUTXO:            {400, "BTM703", "Not found UTXO with given hash"},
+       account.ErrMatchUTXO:            {400, "BTM703", "UTXO with given hash not found"},
        ErrBadActionType:                {400, "BTM704", "Invalid action type"},
        ErrBadAction:                    {400, "BTM705", "Invalid action object"},
        ErrBadActionConstruction:        {400, "BTM706", "Invalid action construction"},
        txbuilder.ErrMissingFields:      {400, "BTM707", "One or more fields are missing"},
        txbuilder.ErrBadAmount:          {400, "BTM708", "Invalid asset amount"},
-       account.ErrFindAccount:          {400, "BTM709", "Not found account"},
-       asset.ErrFindAsset:              {400, "BTM710", "Not found asset"},
+       account.ErrFindAccount:          {400, "BTM709", "Account not found"},
+       asset.ErrFindAsset:              {400, "BTM710", "Asset not found"},
        txbuilder.ErrBadContractArgType: {400, "BTM711", "Invalid contract argument type"},
-       txbuilder.ErrOrphanTx:           {400, "BTM712", "Not found transaction input utxo"},
-       txbuilder.ErrExtTxFee:           {400, "BTM713", "Transaction fee exceed max limit"},
+       txbuilder.ErrOrphanTx:           {400, "BTM712", "Transaction input UTXO not found"},
+       txbuilder.ErrExtTxFee:           {400, "BTM713", "Transaction fee exceeded max limit"},
        txbuilder.ErrNoGasInput:         {400, "BTM714", "Transaction has no gas input"},
 
        // Submit transaction error namespace (73x ~ 79x)