Merge PR #2444: Standardize REST error responses

This commit is contained in:
Federico Kunze
2018-10-19 18:55:20 +02:00
committed by Christopher Goes
parent 505c356f20
commit ad355d6c69
20 changed files with 160 additions and 168 deletions
+2 -6
View File
@@ -55,15 +55,11 @@ func (ctx CLIContext) BroadcastTxAndAwaitCommit(tx []byte) (*ctypes.ResultBroadc
}
if !res.CheckTx.IsOK() {
return res, errors.Errorf("checkTx failed: (%d) %s",
res.CheckTx.Code,
res.CheckTx.Log)
return res, errors.Errorf(res.CheckTx.Log)
}
if !res.DeliverTx.IsOK() {
return res, errors.Errorf("deliverTx failed: (%d) %s",
res.DeliverTx.Code,
res.DeliverTx.Log)
return res, errors.Errorf(res.DeliverTx.Log)
}
return res, err
+1 -1
View File
@@ -168,7 +168,7 @@ func (ctx CLIContext) query(path string, key cmn.HexBytes) (res []byte, err erro
resp := result.Response
if !resp.IsOK() {
return res, errors.Errorf("query failed: (%d) %s", resp.Code, resp.Log)
return res, errors.Errorf(resp.Log)
}
// data from trusted node or subspace query doesn't need verification