Refactor errors package, so we can do type-checking IsXXErr()

This commit is contained in:
Ethan Frey
2017-07-03 14:22:46 +02:00
parent 2fc4da1076
commit 5fa77bf647
4 changed files with 200 additions and 49 deletions
+2 -2
View File
@@ -24,8 +24,8 @@ func TestCreateResult(t *testing.T) {
{New("nonce", abci.CodeType_BadNonce), "nonce", abci.CodeType_BadNonce},
{Wrap(stderr.New("wrap")), "wrap", defaultErrCode},
{WithCode(stderr.New("coded"), abci.CodeType_BaseInvalidInput), "coded", abci.CodeType_BaseInvalidInput},
{DecodingError(), msgDecoding, abci.CodeType_EncodingError},
{Unauthorized(), msgUnauthorized, abci.CodeType_Unauthorized},
{ErrDecoding(), errDecoding.Error(), abci.CodeType_EncodingError},
{ErrUnauthorized(), errUnauthorized.Error(), abci.CodeType_Unauthorized},
}
for idx, tc := range cases {