Vladimir Davydov
authored
The new IPROTO protocol feature IPROTO_FEATURE_ERROR_EXTENSION enables encoding errors returned by CALL/EVAL commands as the MP_ERROR MsgPack extension. Note, the MP_ERROR extension can still be disabled globally by setting msgpack.cfg.encode_error_as_ext to false. If an IPROTO client doesn't set the feature bit, errors will be encoded as generic cdata objects (converted to strings by default). Needed for #6428 @TarantoolBot document Title: Document IPROTO_FEATURE_ERROR_EXTENSION A new feature bit for the IPROTO_ID command was added: ``` IPROTO_FEATURE_ERROR_EXTENSION = 2 ``` The protocol version was incremented - now it equals 2. If a network client sets this bit, errors returned by CALL/EVAL will be encoded as the MP_ERROR MsgPack extension (unless disabled globally by msgpack.cfg.encode_error_as_ext). If the bit is unset, errors will be encoded according to the serialization rules used for generic cdata objects (converted to strings by default). The built-in net.box connector sets this feature bit. The server sets this feature bit if it supports the MP_ERROR MsgPack extension so a net.box client can explicitly request the feature upon connecting to a server: ```lua net.box.connect(uri, {required_protocol_features = {'error_extension'}}) ```