Skip to content

Commit

Permalink
code health: rename error iproto code
Browse files Browse the repository at this point in the history
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
  • Loading branch information
DifferentialOrange committed Dec 1, 2022
1 parent d6d0031 commit 3afc90d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion const.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const (
KeyExpression = 0x27
KeyDefTuple = 0x28
KeyData = 0x30
KeyError = 0x31
KeyError24 = 0x31
KeyMetaData = 0x32
KeyBindCount = 0x34
KeySQLText = 0x40
Expand Down
4 changes: 2 additions & 2 deletions response.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down Expand Up @@ -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
}
Expand Down

0 comments on commit 3afc90d

Please sign in to comment.