[Tarantool-patches] [PATCH V4 4/6] error: add session setting for error type marshaling

Vladislav Shpilevoy v.shpilevoy at tarantool.org
Fri Apr 17 03:51:54 MSK 2020


Hi!

On 16/04/2020 21:48, Konstantin Osipov wrote:
> * Leonid Vasiliev <lvasiliev at tarantool.org> [20/04/16 20:45]:
>> Errors are encoded as a string when serialized to MessagePack to
>> be sent over IProto or when just saved into a buffer via Lua
>> modules msgpackffi and msgpack.
>>
>> That is not very useful on client-side, because most of the error
>> metadata is lost: code, type, trace - everything except the
>> message.
>>
>> Next commits are going to dedicate a new MP_EXT type to error
>> objects so as everything could be encoded, and on client side it
>> would be possible to restore types.
>>
>> But this is a breaking change in case some users use old
>> connectors when work with newer Tarantool instances. So to smooth
>> the upgrade there is a new session setting -
>> 'error_marshaling_enabled'.
>>
>> By default it is false. When it is true, all fibers of the given
>> session will serialize error objects as MP_EXT.
> 
> I don't understand the point of having an MP_EXT if the same
> can be achieved with simply a new messagepack key. There is
> already IPROTO_ERROR_CODE, IPROTO_ERROR_MESSAGE, why can't you add
> IPROTO_ERROR_TYPE? 

Seems like you are talking about the case when error object is
thrown as an exception. But the patchset is about being able to
recognize and decode errors even when they are returned inside
response body, as a part of IPROTO_OK response type.


More information about the Tarantool-patches mailing list