From ece0133670f50003baa75322a69df8f6d067a0b4 Mon Sep 17 00:00:00 2001 From: zhoujunlong Date: Mon, 12 Sep 2016 15:31:59 +0800 Subject: [PATCH] fix the bug of can not get batchOpError --- decoder.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/decoder.go b/decoder.go index 33684e5..9ddaca1 100644 --- a/decoder.go +++ b/decoder.go @@ -75,7 +75,7 @@ func (p *batchOpDecoder) DecodeError(bodyBytes []byte, resource string) (decoded bodyReader.Seek(0, 0) errResp := ErrorResponse{} err = decoder.Decode(&errResp) - if err != nil { + if err == nil { decodedError = ParseError(errResp, resource) } } else {