From 594e5a9446711cf2430272b8927f25f13f7e2163 Mon Sep 17 00:00:00 2001 From: Georgy Moiseev Date: Fri, 11 Nov 2022 18:46:07 +0300 Subject: [PATCH] code health: rename error iproto code Since 2.4.1 IPROTO_ERROR (0x31) is renamed to IPROTO_ERROR_24 and IPROTO_ERROR name is used for 0x52 constant describing extended error info [1]. 1. https://www.tarantool.io/en/doc/latest/dev_guide/internals/msgpack_extensions/#the-error-type Part of #209 --- const.go | 2 +- response.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/const.go b/const.go index 35ec83380..8cd9bc490 100644 --- a/const.go +++ b/const.go @@ -35,7 +35,7 @@ const ( KeyExpression = 0x27 KeyDefTuple = 0x28 KeyData = 0x30 - KeyError = 0x31 + KeyError24 = 0x31 KeyMetaData = 0x32 KeyBindCount = 0x34 KeySQLText = 0x40 diff --git a/response.go b/response.go index 9e38e970d..df0b0eca7 100644 --- a/response.go +++ b/response.go @@ -172,7 +172,7 @@ func (resp *Response) decodeBody() (err error) { if resp.Data, ok = res.([]interface{}); !ok { return fmt.Errorf("result is not array: %v", res) } - case KeyError: + case KeyError24: if resp.Error, err = d.DecodeString(); err != nil { return err } @@ -262,7 +262,7 @@ func (resp *Response) decodeBodyTyped(res interface{}) (err error) { if err = d.Decode(res); err != nil { return err } - case KeyError: + case KeyError24: if resp.Error, err = d.DecodeString(); err != nil { return err }